@supernova-studio/client 0.17.0 → 0.19.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/dist/index.d.mts +8862 -31305
- package/dist/index.d.ts +8862 -31305
- package/dist/index.js +130 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -140
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/documentation/documentation-group-to-dto.ts +1 -0
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +1 -0
- package/src/api/dto/elements/documentation/group-action.ts +21 -4
- package/src/api/dto/elements/documentation/group.ts +27 -0
- package/src/api/dto/elements/documentation/index.ts +0 -2
- package/src/api/dto/elements/documentation/page-actions-v2.ts +21 -4
- package/src/api/dto/elements/documentation/page-v2.ts +9 -2
- package/src/api/dto/elements/elements-action-v2.ts +8 -0
- 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.js
CHANGED
|
@@ -982,7 +982,12 @@ var PageBlockItemDividerValue = _zod.z.object({});
|
|
|
982
982
|
var PageBlockItemEmbedValue = _zod.z.object({
|
|
983
983
|
value: _zod.z.string().optional(),
|
|
984
984
|
caption: _zod.z.string().optional(),
|
|
985
|
-
height: _zod.z.number().optional()
|
|
985
|
+
height: _zod.z.number().optional(),
|
|
986
|
+
openGraph: _zod.z.object({
|
|
987
|
+
title: _zod.z.string().optional(),
|
|
988
|
+
description: _zod.z.string().optional(),
|
|
989
|
+
imageUrl: _zod.z.string().optional()
|
|
990
|
+
}).optional()
|
|
986
991
|
});
|
|
987
992
|
var PageBlockItemFigmaNodeValue = _zod.z.object({
|
|
988
993
|
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
@@ -2608,19 +2613,29 @@ var DesignSystemVersionRoom = Entity.extend({
|
|
|
2608
2613
|
});
|
|
2609
2614
|
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
2610
2615
|
pages: _zod.z.array(DocumentationPageV2),
|
|
2611
|
-
groups: _zod.z.array(ElementGroup)
|
|
2612
|
-
deletedPagePersistentIds: _zod.z.array(_zod.z.string()),
|
|
2613
|
-
deletedGroupPersistentIds: _zod.z.array(_zod.z.string())
|
|
2616
|
+
groups: _zod.z.array(ElementGroup)
|
|
2614
2617
|
});
|
|
2615
2618
|
var DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
2616
|
-
|
|
2617
|
-
|
|
2619
|
+
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
2620
|
+
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
2618
2621
|
});
|
|
2619
2622
|
var DocumentationPageRoom = Entity.extend({
|
|
2620
2623
|
designSystemVersionId: _zod.z.string(),
|
|
2621
2624
|
documentationPageId: _zod.z.string(),
|
|
2622
2625
|
liveblocksId: _zod.z.string()
|
|
2623
2626
|
});
|
|
2627
|
+
var PageBlockEditorModel = _zod.z.object({
|
|
2628
|
+
id: _zod.z.string(),
|
|
2629
|
+
data: PageBlockDataV2
|
|
2630
|
+
});
|
|
2631
|
+
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
2632
|
+
page: DocumentationPageV2,
|
|
2633
|
+
pageParent: ElementGroup
|
|
2634
|
+
});
|
|
2635
|
+
var DocumentationPageRoomInitialState = DocumentationPageRoomRoomUpdate.extend({
|
|
2636
|
+
pageBlocks: _zod.z.array(PageBlockEditorModel),
|
|
2637
|
+
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
2638
|
+
});
|
|
2624
2639
|
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
2625
2640
|
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
2626
2641
|
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
@@ -3455,7 +3470,8 @@ function documentationPageToStructureDTOV2(page, pagePathMap) {
|
|
|
3455
3470
|
userSlug: page.userSlug,
|
|
3456
3471
|
createdAt: page.createdAt,
|
|
3457
3472
|
updatedAt: page.updatedAt,
|
|
3458
|
-
path
|
|
3473
|
+
path,
|
|
3474
|
+
type: "Page"
|
|
3459
3475
|
};
|
|
3460
3476
|
}
|
|
3461
3477
|
|
|
@@ -3493,7 +3509,8 @@ function elementGroupToDocumentationGroupStructureDTO(group, childrenIdsMap) {
|
|
|
3493
3509
|
childrenIds,
|
|
3494
3510
|
isRoot: !group.parentPersistentId,
|
|
3495
3511
|
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.behavior]), () => ( "Group")),
|
|
3496
|
-
shortPersistentId: group.shortPersistentId
|
|
3512
|
+
shortPersistentId: group.shortPersistentId,
|
|
3513
|
+
type: "Group"
|
|
3497
3514
|
};
|
|
3498
3515
|
}
|
|
3499
3516
|
function calculateChildrenIdsMap(elements, groups) {
|
|
@@ -3574,7 +3591,8 @@ var DTODocumentationGroupStructure = ElementGroup.omit({
|
|
|
3574
3591
|
isRoot: _zod.z.boolean(),
|
|
3575
3592
|
childrenIds: _zod.z.array(_zod.z.string()),
|
|
3576
3593
|
groupBehavior: DocumentationGroupBehavior,
|
|
3577
|
-
shortPersistentId: _zod.z.string()
|
|
3594
|
+
shortPersistentId: _zod.z.string(),
|
|
3595
|
+
type: _zod.z.literal("Group")
|
|
3578
3596
|
});
|
|
3579
3597
|
var DTODocumentationGroup = DTODocumentationGroupStructure.extend({
|
|
3580
3598
|
configuration: DocumentationItemConfiguration
|
|
@@ -3597,6 +3615,13 @@ var DTOUpdateDocumentationGroupInput = _zod.z.object({
|
|
|
3597
3615
|
title: _zod.z.string().optional(),
|
|
3598
3616
|
configuration: DocumentationItemConfiguration.optional()
|
|
3599
3617
|
});
|
|
3618
|
+
var DTOMoveDocumentationGroupInput = _zod.z.object({
|
|
3619
|
+
// Identifier of the group to update
|
|
3620
|
+
id: _zod.z.string().uuid(),
|
|
3621
|
+
// Group placement properties
|
|
3622
|
+
afterPersistentId: _zod.z.string().uuid(),
|
|
3623
|
+
parentPersistentId: _zod.z.string().uuid()
|
|
3624
|
+
});
|
|
3600
3625
|
var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
3601
3626
|
// Identifier of the group to duplicate from
|
|
3602
3627
|
id: _zod.z.string(),
|
|
@@ -3606,6 +3631,17 @@ var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
|
3606
3631
|
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3607
3632
|
parentPersistentId: _zod.z.string().uuid()
|
|
3608
3633
|
});
|
|
3634
|
+
var DTOCreateDocumentationTabGroupInput = _zod.z.object({
|
|
3635
|
+
// New group persistent id
|
|
3636
|
+
persistentId: _zod.z.string().uuid(),
|
|
3637
|
+
// Page that will become first tab of the tab group
|
|
3638
|
+
fromPageId: _zod.z.string(),
|
|
3639
|
+
tabName: _zod.z.string()
|
|
3640
|
+
});
|
|
3641
|
+
var DTODeleteDocumentationTabGroupInput = _zod.z.object({
|
|
3642
|
+
// Deleted group id
|
|
3643
|
+
id: _zod.z.string()
|
|
3644
|
+
});
|
|
3609
3645
|
var DTODeleteDocumentationGroupInput = _zod.z.object({
|
|
3610
3646
|
// Identifier
|
|
3611
3647
|
id: _zod.z.string(),
|
|
@@ -3614,21 +3650,28 @@ var DTODeleteDocumentationGroupInput = _zod.z.object({
|
|
|
3614
3650
|
});
|
|
3615
3651
|
|
|
3616
3652
|
// src/api/dto/elements/documentation/group-action.ts
|
|
3653
|
+
var SuccessPayload = _zod.z.object({
|
|
3654
|
+
success: _zod.z.literal(true)
|
|
3655
|
+
});
|
|
3617
3656
|
var DTODocumentationGroupCreateActionOutputV2 = _zod.z.object({
|
|
3618
3657
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3619
|
-
output:
|
|
3658
|
+
output: SuccessPayload
|
|
3620
3659
|
});
|
|
3621
3660
|
var DTODocumentationGroupUpdateActionOutputV2 = _zod.z.object({
|
|
3622
3661
|
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3623
|
-
output:
|
|
3662
|
+
output: SuccessPayload
|
|
3663
|
+
});
|
|
3664
|
+
var DTODocumentationGroupMoveActionOutputV2 = _zod.z.object({
|
|
3665
|
+
type: _zod.z.literal("DocumentationGroupMove"),
|
|
3666
|
+
output: SuccessPayload
|
|
3624
3667
|
});
|
|
3625
3668
|
var DTODocumentationGroupDuplicateActionOutputV2 = _zod.z.object({
|
|
3626
3669
|
type: _zod.z.literal("DocumentationGroupDuplicate"),
|
|
3627
|
-
output:
|
|
3670
|
+
output: SuccessPayload
|
|
3628
3671
|
});
|
|
3629
3672
|
var DTODocumentationGroupDeleteActionOutputV2 = _zod.z.object({
|
|
3630
3673
|
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3631
|
-
output:
|
|
3674
|
+
output: SuccessPayload
|
|
3632
3675
|
});
|
|
3633
3676
|
var DTODocumentationGroupCreateActionInputV2 = _zod.z.object({
|
|
3634
3677
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
@@ -3638,6 +3681,10 @@ var DTODocumentationGroupUpdateActionInputV2 = _zod.z.object({
|
|
|
3638
3681
|
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3639
3682
|
input: DTOUpdateDocumentationGroupInput
|
|
3640
3683
|
});
|
|
3684
|
+
var DTODocumentationGroupMoveActionInputV2 = _zod.z.object({
|
|
3685
|
+
type: _zod.z.literal("DocumentationGroupMove"),
|
|
3686
|
+
input: DTOMoveDocumentationGroupInput
|
|
3687
|
+
});
|
|
3641
3688
|
var DTODocumentationGroupDuplicateActionInputV2 = _zod.z.object({
|
|
3642
3689
|
type: _zod.z.literal("DocumentationGroupDuplicate"),
|
|
3643
3690
|
input: DTODuplicateDocumentationGroupInput
|
|
@@ -3647,20 +3694,6 @@ var DTODocumentationGroupDeleteActionInputV2 = _zod.z.object({
|
|
|
3647
3694
|
input: DTODeleteDocumentationGroupInput
|
|
3648
3695
|
});
|
|
3649
3696
|
|
|
3650
|
-
// src/api/dto/elements/documentation/group-bulk-action.ts
|
|
3651
|
-
|
|
3652
|
-
var DTODocumentationGroupBulkActionOutputV2 = _zod.z.object({
|
|
3653
|
-
created: _zod.z.array(DTODocumentationGroup),
|
|
3654
|
-
updated: _zod.z.array(DTODocumentationGroup),
|
|
3655
|
-
deleted: _zod.z.array(_zod.z.string())
|
|
3656
|
-
});
|
|
3657
|
-
var DTODocumentationGroupBulkActionInputV2 = _zod.z.object({
|
|
3658
|
-
create: _zod.z.array(DTOCreateDocumentationGroupInput).optional(),
|
|
3659
|
-
update: _zod.z.array(DTOUpdateDocumentationGroupInput).optional(),
|
|
3660
|
-
duplicate: _zod.z.array(DTODuplicateDocumentationGroupInput).optional(),
|
|
3661
|
-
delete: _zod.z.array(_zod.z.string()).optional()
|
|
3662
|
-
});
|
|
3663
|
-
|
|
3664
3697
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3665
3698
|
|
|
3666
3699
|
|
|
@@ -3673,7 +3706,8 @@ var DTODocumentationPageStructureV2 = DocumentationPageV2.omit({
|
|
|
3673
3706
|
sortOrder: true
|
|
3674
3707
|
}).extend({
|
|
3675
3708
|
title: _zod.z.string(),
|
|
3676
|
-
path: _zod.z.string()
|
|
3709
|
+
path: _zod.z.string(),
|
|
3710
|
+
type: _zod.z.literal("Page")
|
|
3677
3711
|
});
|
|
3678
3712
|
var DTODocumentationPageV2 = DTODocumentationPageStructureV2.extend({
|
|
3679
3713
|
configuration: DocumentationItemConfiguration
|
|
@@ -3697,10 +3731,14 @@ var DTOUpdateDocumentationPageInputV2 = _zod.z.object({
|
|
|
3697
3731
|
id: _zod.z.string(),
|
|
3698
3732
|
// Page properties
|
|
3699
3733
|
title: _zod.z.string().optional(),
|
|
3700
|
-
configuration: DocumentationItemConfiguration.optional()
|
|
3734
|
+
configuration: DocumentationItemConfiguration.optional()
|
|
3735
|
+
});
|
|
3736
|
+
var DTOMoveDocumentationPageInputV2 = _zod.z.object({
|
|
3737
|
+
// Identifier of the group to update
|
|
3738
|
+
id: _zod.z.string(),
|
|
3701
3739
|
// Page placement properties
|
|
3702
|
-
parentPersistentId: _zod.z.string().
|
|
3703
|
-
afterPersistentId: _zod.z.string().
|
|
3740
|
+
parentPersistentId: _zod.z.string().uuid(),
|
|
3741
|
+
afterPersistentId: _zod.z.string().uuid()
|
|
3704
3742
|
});
|
|
3705
3743
|
var DTODuplicateDocumentationPageInputV2 = _zod.z.object({
|
|
3706
3744
|
// Identifier of the page to duplicate from
|
|
@@ -3717,21 +3755,28 @@ var DTODeleteDocumentationPageInputV2 = _zod.z.object({
|
|
|
3717
3755
|
});
|
|
3718
3756
|
|
|
3719
3757
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3758
|
+
var SuccessPayload2 = _zod.z.object({
|
|
3759
|
+
success: _zod.z.literal(true)
|
|
3760
|
+
});
|
|
3720
3761
|
var DTODocumentationPageCreateActionOutputV2 = _zod.z.object({
|
|
3721
3762
|
type: _zod.z.literal("DocumentationPageCreate"),
|
|
3722
|
-
output:
|
|
3763
|
+
output: SuccessPayload2
|
|
3723
3764
|
});
|
|
3724
3765
|
var DTODocumentationPageUpdateActionOutputV2 = _zod.z.object({
|
|
3725
3766
|
type: _zod.z.literal("DocumentationPageUpdate"),
|
|
3726
|
-
output:
|
|
3767
|
+
output: SuccessPayload2
|
|
3768
|
+
});
|
|
3769
|
+
var DTODocumentationPageMoveActionOutputV2 = _zod.z.object({
|
|
3770
|
+
type: _zod.z.literal("DocumentationPageMove"),
|
|
3771
|
+
output: SuccessPayload2
|
|
3727
3772
|
});
|
|
3728
3773
|
var DTODocumentationPageDuplicateActionOutputV2 = _zod.z.object({
|
|
3729
3774
|
type: _zod.z.literal("DocumentationPageDuplicate"),
|
|
3730
|
-
output:
|
|
3775
|
+
output: SuccessPayload2
|
|
3731
3776
|
});
|
|
3732
3777
|
var DTODocumentationPageDeleteActionOutputV2 = _zod.z.object({
|
|
3733
3778
|
type: _zod.z.literal("DocumentationPageDelete"),
|
|
3734
|
-
output:
|
|
3779
|
+
output: SuccessPayload2
|
|
3735
3780
|
});
|
|
3736
3781
|
var DTODocumentationPageCreateActionInputV2 = _zod.z.object({
|
|
3737
3782
|
type: _zod.z.literal("DocumentationPageCreate"),
|
|
@@ -3741,6 +3786,10 @@ var DTODocumentationPageUpdateActionInputV2 = _zod.z.object({
|
|
|
3741
3786
|
type: _zod.z.literal("DocumentationPageUpdate"),
|
|
3742
3787
|
input: DTOUpdateDocumentationPageInputV2
|
|
3743
3788
|
});
|
|
3789
|
+
var DTODocumentationPageMoveActionInputV2 = _zod.z.object({
|
|
3790
|
+
type: _zod.z.literal("DocumentationPageMove"),
|
|
3791
|
+
input: DTOMoveDocumentationPageInputV2
|
|
3792
|
+
});
|
|
3744
3793
|
var DTODocumentationPageDuplicateActionInputV2 = _zod.z.object({
|
|
3745
3794
|
type: _zod.z.literal("DocumentationPageDuplicate"),
|
|
3746
3795
|
input: DTODuplicateDocumentationPageInputV2
|
|
@@ -3750,20 +3799,6 @@ var DTODocumentationPageDeleteActionInputV2 = _zod.z.object({
|
|
|
3750
3799
|
input: DTODeleteDocumentationPageInputV2
|
|
3751
3800
|
});
|
|
3752
3801
|
|
|
3753
|
-
// src/api/dto/elements/documentation/page-bulk-action-v2.ts
|
|
3754
|
-
|
|
3755
|
-
var DTODocumentationPageBulkActionOutputV2 = _zod.z.object({
|
|
3756
|
-
created: _zod.z.array(DTODocumentationPageV2),
|
|
3757
|
-
updated: _zod.z.array(DTODocumentationPageV2),
|
|
3758
|
-
deleted: _zod.z.array(_zod.z.string())
|
|
3759
|
-
});
|
|
3760
|
-
var DTODocumentationPageBulkActionInputV2 = _zod.z.object({
|
|
3761
|
-
create: _zod.z.array(DTOCreateDocumentationPageInputV2).optional(),
|
|
3762
|
-
update: _zod.z.array(DTOUpdateDocumentationPageInputV2).optional(),
|
|
3763
|
-
duplicate: _zod.z.array(DTODuplicateDocumentationPageInputV2).optional(),
|
|
3764
|
-
delete: _zod.z.array(DTODeleteDocumentationPageInputV2).optional()
|
|
3765
|
-
});
|
|
3766
|
-
|
|
3767
3802
|
// src/api/dto/elements/documentation/page-v1.ts
|
|
3768
3803
|
|
|
3769
3804
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
@@ -3782,11 +3817,13 @@ var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
|
3782
3817
|
// Documentation pages
|
|
3783
3818
|
DTODocumentationPageCreateActionOutputV2,
|
|
3784
3819
|
DTODocumentationPageUpdateActionOutputV2,
|
|
3820
|
+
DTODocumentationPageMoveActionOutputV2,
|
|
3785
3821
|
DTODocumentationPageDuplicateActionOutputV2,
|
|
3786
3822
|
DTODocumentationPageDeleteActionOutputV2,
|
|
3787
3823
|
// Documentation groups
|
|
3788
3824
|
DTODocumentationGroupCreateActionOutputV2,
|
|
3789
3825
|
DTODocumentationGroupUpdateActionOutputV2,
|
|
3826
|
+
DTODocumentationGroupMoveActionOutputV2,
|
|
3790
3827
|
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3791
3828
|
DTODocumentationGroupDeleteActionOutputV2
|
|
3792
3829
|
]);
|
|
@@ -3794,24 +3831,17 @@ var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
|
3794
3831
|
// Documentation pages
|
|
3795
3832
|
DTODocumentationPageCreateActionInputV2,
|
|
3796
3833
|
DTODocumentationPageUpdateActionInputV2,
|
|
3834
|
+
DTODocumentationPageMoveActionInputV2,
|
|
3797
3835
|
DTODocumentationPageDuplicateActionInputV2,
|
|
3798
3836
|
DTODocumentationPageDeleteActionInputV2,
|
|
3799
3837
|
// Documentation groups
|
|
3800
3838
|
DTODocumentationGroupCreateActionInputV2,
|
|
3801
3839
|
DTODocumentationGroupUpdateActionInputV2,
|
|
3840
|
+
DTODocumentationGroupMoveActionInputV2,
|
|
3802
3841
|
DTODocumentationGroupDuplicateActionInputV2,
|
|
3803
3842
|
DTODocumentationGroupDeleteActionInputV2
|
|
3804
3843
|
]);
|
|
3805
3844
|
|
|
3806
|
-
// src/api/dto/elements/elements-bulk-action-v2.ts
|
|
3807
|
-
|
|
3808
|
-
var DTOElementsBulkActionOutputV2 = _zod.z.object({
|
|
3809
|
-
documentationPages: DTODocumentationPageBulkActionOutputV2
|
|
3810
|
-
});
|
|
3811
|
-
var DTOElementsBulkActionInputV2 = _zod.z.object({
|
|
3812
|
-
documentationPages: DTODocumentationPageBulkActionInputV2
|
|
3813
|
-
});
|
|
3814
|
-
|
|
3815
3845
|
// src/api/payloads/documentation/block-definitions.ts
|
|
3816
3846
|
|
|
3817
3847
|
var DTOGetBlockDefinitionsOutput = _zod.z.object({
|
|
@@ -3874,9 +3904,23 @@ function getGroupsYMap(doc) {
|
|
|
3874
3904
|
}
|
|
3875
3905
|
|
|
3876
3906
|
// src/yjs/design-system-content/item-configuration.ts
|
|
3907
|
+
|
|
3908
|
+
var DTODocumentationPageRoomHeaderData = _zod.z.object({
|
|
3909
|
+
title: _zod.z.string(),
|
|
3910
|
+
configuration: DocumentationItemConfiguration
|
|
3911
|
+
});
|
|
3912
|
+
var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
3913
|
+
title: _zod.z.string().optional(),
|
|
3914
|
+
configuration: DocumentationItemConfiguration.omit({ header: true }).extend({ header: DocumentationItemHeader.partial() }).optional()
|
|
3915
|
+
});
|
|
3877
3916
|
function itemConfigurationToYjs(yDoc, item) {
|
|
3878
3917
|
yDoc.transact((trx) => {
|
|
3879
|
-
const
|
|
3918
|
+
const { title, configuration } = item;
|
|
3919
|
+
const header = _optionalChain([configuration, 'optionalAccess', _8 => _8.header]);
|
|
3920
|
+
if (title !== void 0) {
|
|
3921
|
+
const headerYMap = trx.doc.getMap("itemTitle");
|
|
3922
|
+
headerYMap.set("title", title);
|
|
3923
|
+
}
|
|
3880
3924
|
if (header) {
|
|
3881
3925
|
const headerYMap = trx.doc.getMap("itemHeader");
|
|
3882
3926
|
header.description !== void 0 && headerYMap.set("description", header.description);
|
|
@@ -3889,13 +3933,14 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
3889
3933
|
header.showCoverText !== void 0 && headerYMap.set("showCoverText", header.showCoverText);
|
|
3890
3934
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
3891
3935
|
}
|
|
3892
|
-
if (
|
|
3936
|
+
if (_optionalChain([configuration, 'optionalAccess', _9 => _9.showSidebar]) !== void 0) {
|
|
3893
3937
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
3894
|
-
configYMap.set("showSidebar",
|
|
3938
|
+
configYMap.set("showSidebar", configuration.showSidebar);
|
|
3895
3939
|
}
|
|
3896
3940
|
});
|
|
3897
3941
|
}
|
|
3898
3942
|
function yjsToItemConfiguration(yDoc) {
|
|
3943
|
+
const title = yDoc.getMap("itemTitle").get("title");
|
|
3899
3944
|
const headerYMap = yDoc.getMap("itemHeader");
|
|
3900
3945
|
const rawHeader = {
|
|
3901
3946
|
description: headerYMap.get("description"),
|
|
@@ -3913,20 +3958,19 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
3913
3958
|
showSidebar: configYMap.get("showSidebar"),
|
|
3914
3959
|
header: rawHeader
|
|
3915
3960
|
};
|
|
3916
|
-
return
|
|
3961
|
+
return {
|
|
3962
|
+
title: _zod.z.string().parse(title),
|
|
3963
|
+
configuration: DocumentationItemConfiguration.parse(rawConfig)
|
|
3964
|
+
};
|
|
3917
3965
|
}
|
|
3918
3966
|
|
|
3919
3967
|
// src/yjs/docs-editor/model/block.ts
|
|
3920
|
-
|
|
3921
|
-
var PageBlockEditorModel = _zod.z.object({
|
|
3922
|
-
id: _zod.z.string(),
|
|
3923
|
-
data: PageBlockDataV2
|
|
3924
|
-
});
|
|
3968
|
+
var PageBlockEditorModel2 = PageBlockEditorModel;
|
|
3925
3969
|
|
|
3926
3970
|
// src/yjs/docs-editor/model/page.ts
|
|
3927
3971
|
|
|
3928
3972
|
var DocumentationPageEditorModel = _zod.z.object({
|
|
3929
|
-
blocks: _zod.z.array(
|
|
3973
|
+
blocks: _zod.z.array(PageBlockEditorModel2)
|
|
3930
3974
|
});
|
|
3931
3975
|
|
|
3932
3976
|
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
@@ -4751,7 +4795,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
4751
4795
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
4752
4796
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
4753
4797
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
4754
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4798
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _10 => _10.richTextStyle]), () => ( "Default"));
|
|
4755
4799
|
switch (style) {
|
|
4756
4800
|
case "Callout":
|
|
4757
4801
|
return serializeAsCallout(enrichedInput);
|
|
@@ -4808,7 +4852,7 @@ function serializeAsMultiRichTextBlock(input) {
|
|
|
4808
4852
|
const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextProperty.id);
|
|
4809
4853
|
const enrichedInput = { ...input, multiRichTextPropertyValue: textPropertyValue };
|
|
4810
4854
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
4811
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4855
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _11 => _11.multiRichTextStyle]), () => ( "Default"));
|
|
4812
4856
|
switch (style) {
|
|
4813
4857
|
case "Default":
|
|
4814
4858
|
return serializeAsMultiParagraph(enrichedInput);
|
|
@@ -4930,7 +4974,7 @@ function serializeTableNode(node) {
|
|
|
4930
4974
|
return {
|
|
4931
4975
|
type: "image",
|
|
4932
4976
|
attrs: {
|
|
4933
|
-
src: _optionalChain([node, 'access',
|
|
4977
|
+
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.url])
|
|
4934
4978
|
}
|
|
4935
4979
|
};
|
|
4936
4980
|
}
|
|
@@ -4950,7 +4994,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
4950
4994
|
};
|
|
4951
4995
|
}
|
|
4952
4996
|
function richTextHeadingLevel(property) {
|
|
4953
|
-
const style = _optionalChain([property, 'access',
|
|
4997
|
+
const style = _optionalChain([property, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.richTextStyle]);
|
|
4954
4998
|
if (!style)
|
|
4955
4999
|
return void 0;
|
|
4956
5000
|
switch (style) {
|
|
@@ -5048,7 +5092,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
5048
5092
|
linksTo: i.linksTo
|
|
5049
5093
|
};
|
|
5050
5094
|
});
|
|
5051
|
-
const columns = _optionalChain([block, 'access',
|
|
5095
|
+
const columns = _optionalChain([block, 'access', _16 => _16.data, 'access', _17 => _17.appearance, 'optionalAccess', _18 => _18.numberOfColumns]);
|
|
5052
5096
|
return {
|
|
5053
5097
|
type: "blockNode",
|
|
5054
5098
|
attrs: {
|
|
@@ -7674,7 +7718,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
7674
7718
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
7675
7719
|
if (listItem.type !== "listItem")
|
|
7676
7720
|
return null;
|
|
7677
|
-
if (!_optionalChain([listItem, 'access',
|
|
7721
|
+
if (!_optionalChain([listItem, 'access', _19 => _19.content, 'optionalAccess', _20 => _20.length]))
|
|
7678
7722
|
return parseRichText([]);
|
|
7679
7723
|
const paragraph = listItem.content[0];
|
|
7680
7724
|
if (paragraph.type !== "paragraph")
|
|
@@ -7717,7 +7761,7 @@ function parseRichTextAttribute(mark) {
|
|
|
7717
7761
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
7718
7762
|
return {
|
|
7719
7763
|
type: "Link",
|
|
7720
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7764
|
+
openInNewWindow: _optionalChain([mark, 'access', _21 => _21.attrs, 'optionalAccess', _22 => _22.target]) !== "_self",
|
|
7721
7765
|
documentationItemId: itemId,
|
|
7722
7766
|
link: href
|
|
7723
7767
|
};
|
|
@@ -7730,17 +7774,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7730
7774
|
return null;
|
|
7731
7775
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7732
7776
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
7733
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7777
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _23 => _23.content, 'optionalAccess', _24 => _24.find, 'call', _25 => _25((c) => c.type === "table")]);
|
|
7734
7778
|
if (!tableChild) {
|
|
7735
7779
|
return emptyTable(id, variantId, 0);
|
|
7736
7780
|
}
|
|
7737
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7781
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _26 => _26.content, 'optionalAccess', _27 => _27.filter, 'call', _28 => _28((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _29 => _29.content, 'optionalAccess', _30 => _30.length]))]), () => ( []));
|
|
7738
7782
|
if (!rows.length) {
|
|
7739
7783
|
return emptyTable(id, variantId, 0);
|
|
7740
7784
|
}
|
|
7741
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
7742
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
7743
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7785
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _31 => _31[0], 'access', _32 => _32.content, 'optionalAccess', _33 => _33.filter, 'call', _34 => _34((c) => c.type === "tableHeader"), 'access', _35 => _35.length]), () => ( 0));
|
|
7786
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _36 => _36.content, 'optionalAccess', _37 => _37[0], 'optionalAccess', _38 => _38.type]) === "tableHeader").length;
|
|
7787
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _39 => _39[0], 'access', _40 => _40.content, 'optionalAccess', _41 => _41.length]) === rowHeaderCells;
|
|
7744
7788
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
7745
7789
|
const tableValue = {
|
|
7746
7790
|
showBorder: hasBorder,
|
|
@@ -8021,7 +8065,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
8021
8065
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
8022
8066
|
}
|
|
8023
8067
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8024
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8068
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _42 => _42.attrs, 'optionalAccess', _43 => _43[attributeName]]));
|
|
8025
8069
|
if (parsedAttr.success) {
|
|
8026
8070
|
return parsedAttr.data;
|
|
8027
8071
|
} else {
|
|
@@ -8109,5 +8153,9 @@ function mapByUnique2(items, keyFn) {
|
|
|
8109
8153
|
|
|
8110
8154
|
|
|
8111
8155
|
|
|
8112
|
-
|
|
8156
|
+
|
|
8157
|
+
|
|
8158
|
+
|
|
8159
|
+
|
|
8160
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTOCreateDocumentationTabGroupInput = DTOCreateDocumentationTabGroupInput; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODeleteDocumentationTabGroupInput = DTODeleteDocumentationTabGroupInput; exports.DTODesignSystem = DTODesignSystem; exports.DTODocumentationGroup = DTODocumentationGroup; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupMoveActionInputV2 = DTODocumentationGroupMoveActionInputV2; exports.DTODocumentationGroupMoveActionOutputV2 = DTODocumentationGroupMoveActionOutputV2; exports.DTODocumentationGroupStructure = DTODocumentationGroupStructure; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; exports.DTODocumentationPageMoveActionInputV2 = DTODocumentationPageMoveActionInputV2; exports.DTODocumentationPageMoveActionOutputV2 = DTODocumentationPageMoveActionOutputV2; exports.DTODocumentationPageRoomHeaderData = DTODocumentationPageRoomHeaderData; exports.DTODocumentationPageRoomHeaderDataUpdate = DTODocumentationPageRoomHeaderDataUpdate; exports.DTODocumentationPageStructureV2 = DTODocumentationPageStructureV2; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOMoveDocumentationGroupInput = DTOMoveDocumentationGroupInput; exports.DTOMoveDocumentationPageInputV2 = DTOMoveDocumentationPageInputV2; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.PageBlockEditorModel = PageBlockEditorModel2; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.documentationElementsToHierarchyDto = documentationElementsToHierarchyDto; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.documentationPagesToStructureDTOV2 = documentationPagesToStructureDTOV2; exports.elementGroupsToDocumentationGroupDTO = elementGroupsToDocumentationGroupDTO; exports.elementGroupsToDocumentationGroupStructureDTO = elementGroupsToDocumentationGroupStructureDTO; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pmSchema = pmSchema; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorNodeToBlock = prosemirrorNodeToBlock; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
|
|
8113
8161
|
//# sourceMappingURL=index.js.map
|