@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.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";
|
|
@@ -3595,7 +3610,10 @@ var DTOUpdateDocumentationGroupInput = _zod.z.object({
|
|
|
3595
3610
|
id: _zod.z.string().uuid(),
|
|
3596
3611
|
// Group properties
|
|
3597
3612
|
title: _zod.z.string().optional(),
|
|
3598
|
-
configuration: DocumentationItemConfiguration.optional()
|
|
3613
|
+
configuration: DocumentationItemConfiguration.optional(),
|
|
3614
|
+
// Group placement properties
|
|
3615
|
+
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3616
|
+
parentPersistentId: _zod.z.string().uuid().optional()
|
|
3599
3617
|
});
|
|
3600
3618
|
var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
3601
3619
|
// Identifier of the group to duplicate from
|
|
@@ -3606,6 +3624,17 @@ var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
|
3606
3624
|
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3607
3625
|
parentPersistentId: _zod.z.string().uuid()
|
|
3608
3626
|
});
|
|
3627
|
+
var DTOCreateDocumentationTabGroupInput = _zod.z.object({
|
|
3628
|
+
// New group persistent id
|
|
3629
|
+
persistentId: _zod.z.string().uuid(),
|
|
3630
|
+
// Page that will become first tab of the tab group
|
|
3631
|
+
fromPageId: _zod.z.string(),
|
|
3632
|
+
tabName: _zod.z.string()
|
|
3633
|
+
});
|
|
3634
|
+
var DTODeleteDocumentationTabGroupInput = _zod.z.object({
|
|
3635
|
+
// Deleted group id
|
|
3636
|
+
id: _zod.z.string()
|
|
3637
|
+
});
|
|
3609
3638
|
var DTODeleteDocumentationGroupInput = _zod.z.object({
|
|
3610
3639
|
// Identifier
|
|
3611
3640
|
id: _zod.z.string(),
|
|
@@ -3614,21 +3643,24 @@ var DTODeleteDocumentationGroupInput = _zod.z.object({
|
|
|
3614
3643
|
});
|
|
3615
3644
|
|
|
3616
3645
|
// src/api/dto/elements/documentation/group-action.ts
|
|
3646
|
+
var SuccessPayload = _zod.z.object({
|
|
3647
|
+
success: _zod.z.literal(true)
|
|
3648
|
+
});
|
|
3617
3649
|
var DTODocumentationGroupCreateActionOutputV2 = _zod.z.object({
|
|
3618
3650
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3619
|
-
output:
|
|
3651
|
+
output: SuccessPayload
|
|
3620
3652
|
});
|
|
3621
3653
|
var DTODocumentationGroupUpdateActionOutputV2 = _zod.z.object({
|
|
3622
3654
|
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3623
|
-
output:
|
|
3655
|
+
output: SuccessPayload
|
|
3624
3656
|
});
|
|
3625
3657
|
var DTODocumentationGroupDuplicateActionOutputV2 = _zod.z.object({
|
|
3626
3658
|
type: _zod.z.literal("DocumentationGroupDuplicate"),
|
|
3627
|
-
output:
|
|
3659
|
+
output: SuccessPayload
|
|
3628
3660
|
});
|
|
3629
3661
|
var DTODocumentationGroupDeleteActionOutputV2 = _zod.z.object({
|
|
3630
3662
|
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3631
|
-
output:
|
|
3663
|
+
output: SuccessPayload
|
|
3632
3664
|
});
|
|
3633
3665
|
var DTODocumentationGroupCreateActionInputV2 = _zod.z.object({
|
|
3634
3666
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
@@ -3647,20 +3679,6 @@ var DTODocumentationGroupDeleteActionInputV2 = _zod.z.object({
|
|
|
3647
3679
|
input: DTODeleteDocumentationGroupInput
|
|
3648
3680
|
});
|
|
3649
3681
|
|
|
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
3682
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3665
3683
|
|
|
3666
3684
|
|
|
@@ -3717,21 +3735,24 @@ var DTODeleteDocumentationPageInputV2 = _zod.z.object({
|
|
|
3717
3735
|
});
|
|
3718
3736
|
|
|
3719
3737
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3738
|
+
var SuccessPayload2 = _zod.z.object({
|
|
3739
|
+
success: _zod.z.literal(true)
|
|
3740
|
+
});
|
|
3720
3741
|
var DTODocumentationPageCreateActionOutputV2 = _zod.z.object({
|
|
3721
3742
|
type: _zod.z.literal("DocumentationPageCreate"),
|
|
3722
|
-
output:
|
|
3743
|
+
output: SuccessPayload2
|
|
3723
3744
|
});
|
|
3724
3745
|
var DTODocumentationPageUpdateActionOutputV2 = _zod.z.object({
|
|
3725
3746
|
type: _zod.z.literal("DocumentationPageUpdate"),
|
|
3726
|
-
output:
|
|
3747
|
+
output: SuccessPayload2
|
|
3727
3748
|
});
|
|
3728
3749
|
var DTODocumentationPageDuplicateActionOutputV2 = _zod.z.object({
|
|
3729
3750
|
type: _zod.z.literal("DocumentationPageDuplicate"),
|
|
3730
|
-
output:
|
|
3751
|
+
output: SuccessPayload2
|
|
3731
3752
|
});
|
|
3732
3753
|
var DTODocumentationPageDeleteActionOutputV2 = _zod.z.object({
|
|
3733
3754
|
type: _zod.z.literal("DocumentationPageDelete"),
|
|
3734
|
-
output:
|
|
3755
|
+
output: SuccessPayload2
|
|
3735
3756
|
});
|
|
3736
3757
|
var DTODocumentationPageCreateActionInputV2 = _zod.z.object({
|
|
3737
3758
|
type: _zod.z.literal("DocumentationPageCreate"),
|
|
@@ -3750,20 +3771,6 @@ var DTODocumentationPageDeleteActionInputV2 = _zod.z.object({
|
|
|
3750
3771
|
input: DTODeleteDocumentationPageInputV2
|
|
3751
3772
|
});
|
|
3752
3773
|
|
|
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
3774
|
// src/api/dto/elements/documentation/page-v1.ts
|
|
3768
3775
|
|
|
3769
3776
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
@@ -3803,15 +3810,6 @@ var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
|
3803
3810
|
DTODocumentationGroupDeleteActionInputV2
|
|
3804
3811
|
]);
|
|
3805
3812
|
|
|
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
3813
|
// src/api/payloads/documentation/block-definitions.ts
|
|
3816
3814
|
|
|
3817
3815
|
var DTOGetBlockDefinitionsOutput = _zod.z.object({
|
|
@@ -3874,9 +3872,23 @@ function getGroupsYMap(doc) {
|
|
|
3874
3872
|
}
|
|
3875
3873
|
|
|
3876
3874
|
// src/yjs/design-system-content/item-configuration.ts
|
|
3875
|
+
|
|
3876
|
+
var DTODocumentationPageRoomHeaderData = _zod.z.object({
|
|
3877
|
+
title: _zod.z.string(),
|
|
3878
|
+
configuration: DocumentationItemConfiguration
|
|
3879
|
+
});
|
|
3880
|
+
var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
3881
|
+
title: _zod.z.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 = _optionalChain([configuration, 'optionalAccess', _8 => _8.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 (_optionalChain([configuration, 'optionalAccess', _9 => _9.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: _zod.z.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 = _zod.z.object({
|
|
3922
|
-
id: _zod.z.string(),
|
|
3923
|
-
data: PageBlockDataV2
|
|
3924
|
-
});
|
|
3936
|
+
var PageBlockEditorModel2 = PageBlockEditorModel;
|
|
3925
3937
|
|
|
3926
3938
|
// src/yjs/docs-editor/model/page.ts
|
|
3927
3939
|
|
|
3928
3940
|
var DocumentationPageEditorModel = _zod.z.object({
|
|
3929
|
-
blocks: _zod.z.array(
|
|
3941
|
+
blocks: _zod.z.array(PageBlockEditorModel2)
|
|
3930
3942
|
});
|
|
3931
3943
|
|
|
3932
3944
|
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
@@ -4751,7 +4763,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
4751
4763
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
4752
4764
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
4753
4765
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
4754
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4766
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _10 => _10.richTextStyle]), () => ( "Default"));
|
|
4755
4767
|
switch (style) {
|
|
4756
4768
|
case "Callout":
|
|
4757
4769
|
return serializeAsCallout(enrichedInput);
|
|
@@ -4808,7 +4820,7 @@ function serializeAsMultiRichTextBlock(input) {
|
|
|
4808
4820
|
const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextProperty.id);
|
|
4809
4821
|
const enrichedInput = { ...input, multiRichTextPropertyValue: textPropertyValue };
|
|
4810
4822
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
4811
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4823
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _11 => _11.multiRichTextStyle]), () => ( "Default"));
|
|
4812
4824
|
switch (style) {
|
|
4813
4825
|
case "Default":
|
|
4814
4826
|
return serializeAsMultiParagraph(enrichedInput);
|
|
@@ -4930,7 +4942,7 @@ function serializeTableNode(node) {
|
|
|
4930
4942
|
return {
|
|
4931
4943
|
type: "image",
|
|
4932
4944
|
attrs: {
|
|
4933
|
-
src: _optionalChain([node, 'access',
|
|
4945
|
+
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.url])
|
|
4934
4946
|
}
|
|
4935
4947
|
};
|
|
4936
4948
|
}
|
|
@@ -4950,7 +4962,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
4950
4962
|
};
|
|
4951
4963
|
}
|
|
4952
4964
|
function richTextHeadingLevel(property) {
|
|
4953
|
-
const style = _optionalChain([property, 'access',
|
|
4965
|
+
const style = _optionalChain([property, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.richTextStyle]);
|
|
4954
4966
|
if (!style)
|
|
4955
4967
|
return void 0;
|
|
4956
4968
|
switch (style) {
|
|
@@ -5048,7 +5060,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
5048
5060
|
linksTo: i.linksTo
|
|
5049
5061
|
};
|
|
5050
5062
|
});
|
|
5051
|
-
const columns = _optionalChain([block, 'access',
|
|
5063
|
+
const columns = _optionalChain([block, 'access', _16 => _16.data, 'access', _17 => _17.appearance, 'optionalAccess', _18 => _18.numberOfColumns]);
|
|
5052
5064
|
return {
|
|
5053
5065
|
type: "blockNode",
|
|
5054
5066
|
attrs: {
|
|
@@ -7674,7 +7686,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
7674
7686
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
7675
7687
|
if (listItem.type !== "listItem")
|
|
7676
7688
|
return null;
|
|
7677
|
-
if (!_optionalChain([listItem, 'access',
|
|
7689
|
+
if (!_optionalChain([listItem, 'access', _19 => _19.content, 'optionalAccess', _20 => _20.length]))
|
|
7678
7690
|
return parseRichText([]);
|
|
7679
7691
|
const paragraph = listItem.content[0];
|
|
7680
7692
|
if (paragraph.type !== "paragraph")
|
|
@@ -7717,7 +7729,7 @@ function parseRichTextAttribute(mark) {
|
|
|
7717
7729
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
7718
7730
|
return {
|
|
7719
7731
|
type: "Link",
|
|
7720
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7732
|
+
openInNewWindow: _optionalChain([mark, 'access', _21 => _21.attrs, 'optionalAccess', _22 => _22.target]) !== "_self",
|
|
7721
7733
|
documentationItemId: itemId,
|
|
7722
7734
|
link: href
|
|
7723
7735
|
};
|
|
@@ -7730,17 +7742,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7730
7742
|
return null;
|
|
7731
7743
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7732
7744
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
7733
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7745
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _23 => _23.content, 'optionalAccess', _24 => _24.find, 'call', _25 => _25((c) => c.type === "table")]);
|
|
7734
7746
|
if (!tableChild) {
|
|
7735
7747
|
return emptyTable(id, variantId, 0);
|
|
7736
7748
|
}
|
|
7737
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7749
|
+
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
7750
|
if (!rows.length) {
|
|
7739
7751
|
return emptyTable(id, variantId, 0);
|
|
7740
7752
|
}
|
|
7741
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
7742
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
7743
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7753
|
+
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));
|
|
7754
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _36 => _36.content, 'optionalAccess', _37 => _37[0], 'optionalAccess', _38 => _38.type]) === "tableHeader").length;
|
|
7755
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _39 => _39[0], 'access', _40 => _40.content, 'optionalAccess', _41 => _41.length]) === rowHeaderCells;
|
|
7744
7756
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
7745
7757
|
const tableValue = {
|
|
7746
7758
|
showBorder: hasBorder,
|
|
@@ -8021,7 +8033,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
8021
8033
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
8022
8034
|
}
|
|
8023
8035
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8024
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8036
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _42 => _42.attrs, 'optionalAccess', _43 => _43[attributeName]]));
|
|
8025
8037
|
if (parsedAttr.success) {
|
|
8026
8038
|
return parsedAttr.data;
|
|
8027
8039
|
} else {
|
|
@@ -8107,7 +8119,5 @@ function mapByUnique2(items, keyFn) {
|
|
|
8107
8119
|
|
|
8108
8120
|
|
|
8109
8121
|
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODesignSystem = DTODesignSystem; exports.DTODocumentationGroup = DTODocumentationGroup; exports.DTODocumentationGroupBulkActionInputV2 = DTODocumentationGroupBulkActionInputV2; exports.DTODocumentationGroupBulkActionOutputV2 = DTODocumentationGroupBulkActionOutputV2; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupStructure = DTODocumentationGroupStructure; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationPageBulkActionInputV2 = DTODocumentationPageBulkActionInputV2; exports.DTODocumentationPageBulkActionOutputV2 = DTODocumentationPageBulkActionOutputV2; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; 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.DTOElementsBulkActionInputV2 = DTOElementsBulkActionInputV2; exports.DTOElementsBulkActionOutputV2 = DTOElementsBulkActionOutputV2; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.PageBlockEditorModel = PageBlockEditorModel; 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;
|
|
8122
|
+
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.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.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.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
8123
|
//# sourceMappingURL=index.js.map
|