@supernova-studio/client 0.20.0 → 0.21.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 +1662 -5399
- package/dist/index.d.ts +1662 -5399
- package/dist/index.js +50 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/elements/documentation/group-action.ts +26 -1
- package/src/api/dto/elements/documentation/group.ts +0 -1
- package/src/api/dto/elements/elements-action-v2.ts +16 -0
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +1 -1
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +5 -2
package/dist/index.js
CHANGED
|
@@ -884,24 +884,20 @@ var PageBlockV1 = PageBlockBaseV1.extend({
|
|
|
884
884
|
)
|
|
885
885
|
});
|
|
886
886
|
var PageBlockLinkType = _zod.z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
887
|
-
var PageBlockImageType = _zod.z.enum(["
|
|
887
|
+
var PageBlockImageType = _zod.z.enum(["Resource", "FigmaNode"]);
|
|
888
888
|
var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
889
889
|
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
890
890
|
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
891
891
|
var PageBlockThemeDisplayMode = _zod.z.enum(["Split", "Override"]);
|
|
892
892
|
var PageBlockImageReference = _zod.z.object({
|
|
893
893
|
type: PageBlockImageType,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
resource: _zod.z.object({
|
|
895
|
+
url: _zod.z.string(),
|
|
896
|
+
resourceId: _zod.z.string()
|
|
897
|
+
}).optional(),
|
|
897
898
|
figmaFile: _zod.z.object({
|
|
898
899
|
sourceId: _zod.z.string(),
|
|
899
|
-
|
|
900
|
-
frameReferenceId: _zod.z.string(),
|
|
901
|
-
origin: _zod.z.object({
|
|
902
|
-
title: _zod.z.string().optional(),
|
|
903
|
-
sourceFileName: _zod.z.string().optional()
|
|
904
|
-
})
|
|
900
|
+
frameReferenceId: _zod.z.string()
|
|
905
901
|
}).optional()
|
|
906
902
|
});
|
|
907
903
|
var PageBlockColorV2 = _zod.z.object({
|
|
@@ -1162,7 +1158,7 @@ var DocumentationItemHeaderV2 = _zod.z.object({
|
|
|
1162
1158
|
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
1163
1159
|
foregroundColor: PageBlockColorV2.nullish(),
|
|
1164
1160
|
backgroundColor: PageBlockColorV2.nullish(),
|
|
1165
|
-
backgroundImageAsset:
|
|
1161
|
+
backgroundImageAsset: PageBlockImageReference.nullish(),
|
|
1166
1162
|
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
1167
1163
|
showBackgroundOverlay: _zod.z.boolean(),
|
|
1168
1164
|
showCoverText: _zod.z.boolean(),
|
|
@@ -3637,7 +3633,6 @@ var DTOCreateDocumentationGroupInput = _zod.z.object({
|
|
|
3637
3633
|
// Group properties
|
|
3638
3634
|
title: _zod.z.string(),
|
|
3639
3635
|
configuration: DocumentationItemConfigurationV2.optional(),
|
|
3640
|
-
groupBehavior: DocumentationGroupBehavior,
|
|
3641
3636
|
// Group placement properties
|
|
3642
3637
|
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3643
3638
|
parentPersistentId: _zod.z.string().uuid()
|
|
@@ -3691,6 +3686,10 @@ var DTODocumentationGroupCreateActionOutputV2 = _zod.z.object({
|
|
|
3691
3686
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3692
3687
|
output: SuccessPayload
|
|
3693
3688
|
});
|
|
3689
|
+
var DTODocumentationTabGroupCreateActionOutputV2 = _zod.z.object({
|
|
3690
|
+
type: _zod.z.literal("DocumentationTabGroupCreate"),
|
|
3691
|
+
output: SuccessPayload
|
|
3692
|
+
});
|
|
3694
3693
|
var DTODocumentationGroupUpdateActionOutputV2 = _zod.z.object({
|
|
3695
3694
|
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3696
3695
|
output: SuccessPayload
|
|
@@ -3707,10 +3706,18 @@ var DTODocumentationGroupDeleteActionOutputV2 = _zod.z.object({
|
|
|
3707
3706
|
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3708
3707
|
output: SuccessPayload
|
|
3709
3708
|
});
|
|
3709
|
+
var DTODocumentationTabGroupDeleteActionOutputV2 = _zod.z.object({
|
|
3710
|
+
type: _zod.z.literal("DocumentationTabGroupDelete"),
|
|
3711
|
+
output: SuccessPayload
|
|
3712
|
+
});
|
|
3710
3713
|
var DTODocumentationGroupCreateActionInputV2 = _zod.z.object({
|
|
3711
3714
|
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3712
3715
|
input: DTOCreateDocumentationGroupInput
|
|
3713
3716
|
});
|
|
3717
|
+
var DTODocumentationTabGroupCreateActionInputV2 = _zod.z.object({
|
|
3718
|
+
type: _zod.z.literal("DocumentationTabGroupCreate"),
|
|
3719
|
+
input: DTOCreateDocumentationTabGroupInput
|
|
3720
|
+
});
|
|
3714
3721
|
var DTODocumentationGroupUpdateActionInputV2 = _zod.z.object({
|
|
3715
3722
|
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3716
3723
|
input: DTOUpdateDocumentationGroupInput
|
|
@@ -3727,6 +3734,10 @@ var DTODocumentationGroupDeleteActionInputV2 = _zod.z.object({
|
|
|
3727
3734
|
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3728
3735
|
input: DTODeleteDocumentationGroupInput
|
|
3729
3736
|
});
|
|
3737
|
+
var DTODocumentationTabGroupDeleteActionInputV2 = _zod.z.object({
|
|
3738
|
+
type: _zod.z.literal("DocumentationTabGroupDelete"),
|
|
3739
|
+
input: DTODeleteDocumentationTabGroupInput
|
|
3740
|
+
});
|
|
3730
3741
|
|
|
3731
3742
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3732
3743
|
|
|
@@ -3856,10 +3867,12 @@ var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
|
3856
3867
|
DTODocumentationPageDeleteActionOutputV2,
|
|
3857
3868
|
// Documentation groups
|
|
3858
3869
|
DTODocumentationGroupCreateActionOutputV2,
|
|
3870
|
+
DTODocumentationTabGroupCreateActionOutputV2,
|
|
3859
3871
|
DTODocumentationGroupUpdateActionOutputV2,
|
|
3860
3872
|
DTODocumentationGroupMoveActionOutputV2,
|
|
3861
3873
|
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3862
|
-
DTODocumentationGroupDeleteActionOutputV2
|
|
3874
|
+
DTODocumentationGroupDeleteActionOutputV2,
|
|
3875
|
+
DTODocumentationTabGroupDeleteActionOutputV2
|
|
3863
3876
|
]);
|
|
3864
3877
|
var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
3865
3878
|
// Documentation pages
|
|
@@ -3870,10 +3883,12 @@ var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
|
3870
3883
|
DTODocumentationPageDeleteActionInputV2,
|
|
3871
3884
|
// Documentation groups
|
|
3872
3885
|
DTODocumentationGroupCreateActionInputV2,
|
|
3886
|
+
DTODocumentationTabGroupCreateActionInputV2,
|
|
3873
3887
|
DTODocumentationGroupUpdateActionInputV2,
|
|
3874
3888
|
DTODocumentationGroupMoveActionInputV2,
|
|
3875
3889
|
DTODocumentationGroupDuplicateActionInputV2,
|
|
3876
|
-
DTODocumentationGroupDeleteActionInputV2
|
|
3890
|
+
DTODocumentationGroupDeleteActionInputV2,
|
|
3891
|
+
DTODocumentationTabGroupDeleteActionInputV2
|
|
3877
3892
|
]);
|
|
3878
3893
|
|
|
3879
3894
|
// src/api/payloads/documentation/block-definitions.ts
|
|
@@ -5008,7 +5023,7 @@ function serializeTableNode(node) {
|
|
|
5008
5023
|
return {
|
|
5009
5024
|
type: "image",
|
|
5010
5025
|
attrs: {
|
|
5011
|
-
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.url])
|
|
5026
|
+
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.resource, 'optionalAccess', _14 => _14.url])
|
|
5012
5027
|
}
|
|
5013
5028
|
};
|
|
5014
5029
|
}
|
|
@@ -5028,7 +5043,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
5028
5043
|
};
|
|
5029
5044
|
}
|
|
5030
5045
|
function richTextHeadingLevel(property) {
|
|
5031
|
-
const style = _optionalChain([property, 'access',
|
|
5046
|
+
const style = _optionalChain([property, 'access', _15 => _15.options, 'optionalAccess', _16 => _16.richTextStyle]);
|
|
5032
5047
|
if (!style)
|
|
5033
5048
|
return void 0;
|
|
5034
5049
|
switch (style) {
|
|
@@ -5126,7 +5141,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
5126
5141
|
linksTo: i.linksTo
|
|
5127
5142
|
};
|
|
5128
5143
|
});
|
|
5129
|
-
const columns = _optionalChain([block, 'access',
|
|
5144
|
+
const columns = _optionalChain([block, 'access', _17 => _17.data, 'access', _18 => _18.appearance, 'optionalAccess', _19 => _19.numberOfColumns]);
|
|
5130
5145
|
return {
|
|
5131
5146
|
type: "blockNode",
|
|
5132
5147
|
attrs: {
|
|
@@ -7752,7 +7767,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
7752
7767
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
7753
7768
|
if (listItem.type !== "listItem")
|
|
7754
7769
|
return null;
|
|
7755
|
-
if (!_optionalChain([listItem, 'access',
|
|
7770
|
+
if (!_optionalChain([listItem, 'access', _20 => _20.content, 'optionalAccess', _21 => _21.length]))
|
|
7756
7771
|
return parseRichText([]);
|
|
7757
7772
|
const paragraph = listItem.content[0];
|
|
7758
7773
|
if (paragraph.type !== "paragraph")
|
|
@@ -7795,7 +7810,7 @@ function parseRichTextAttribute(mark) {
|
|
|
7795
7810
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
7796
7811
|
return {
|
|
7797
7812
|
type: "Link",
|
|
7798
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7813
|
+
openInNewWindow: _optionalChain([mark, 'access', _22 => _22.attrs, 'optionalAccess', _23 => _23.target]) !== "_self",
|
|
7799
7814
|
documentationItemId: itemId,
|
|
7800
7815
|
link: href
|
|
7801
7816
|
};
|
|
@@ -7808,17 +7823,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7808
7823
|
return null;
|
|
7809
7824
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7810
7825
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
7811
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7826
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _24 => _24.content, 'optionalAccess', _25 => _25.find, 'call', _26 => _26((c) => c.type === "table")]);
|
|
7812
7827
|
if (!tableChild) {
|
|
7813
7828
|
return emptyTable(id, variantId, 0);
|
|
7814
7829
|
}
|
|
7815
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7830
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _27 => _27.content, 'optionalAccess', _28 => _28.filter, 'call', _29 => _29((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _30 => _30.content, 'optionalAccess', _31 => _31.length]))]), () => ( []));
|
|
7816
7831
|
if (!rows.length) {
|
|
7817
7832
|
return emptyTable(id, variantId, 0);
|
|
7818
7833
|
}
|
|
7819
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
7820
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
7821
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7834
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _32 => _32[0], 'access', _33 => _33.content, 'optionalAccess', _34 => _34.filter, 'call', _35 => _35((c) => c.type === "tableHeader"), 'access', _36 => _36.length]), () => ( 0));
|
|
7835
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _37 => _37.content, 'optionalAccess', _38 => _38[0], 'optionalAccess', _39 => _39.type]) === "tableHeader").length;
|
|
7836
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _40 => _40[0], 'access', _41 => _41.content, 'optionalAccess', _42 => _42.length]) === rowHeaderCells;
|
|
7822
7837
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
7823
7838
|
const tableValue = {
|
|
7824
7839
|
showBorder: hasBorder,
|
|
@@ -7895,8 +7910,11 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
7895
7910
|
return {
|
|
7896
7911
|
type: "Image",
|
|
7897
7912
|
value: {
|
|
7898
|
-
type: "
|
|
7899
|
-
|
|
7913
|
+
type: "Resource",
|
|
7914
|
+
resource: {
|
|
7915
|
+
resourceId: "",
|
|
7916
|
+
url
|
|
7917
|
+
}
|
|
7900
7918
|
}
|
|
7901
7919
|
};
|
|
7902
7920
|
default:
|
|
@@ -8099,7 +8117,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
8099
8117
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
8100
8118
|
}
|
|
8101
8119
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8102
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8120
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _43 => _43.attrs, 'optionalAccess', _44 => _44[attributeName]]));
|
|
8103
8121
|
if (parsedAttr.success) {
|
|
8104
8122
|
return parsedAttr.data;
|
|
8105
8123
|
} else {
|
|
@@ -8191,5 +8209,9 @@ function mapByUnique2(items, keyFn) {
|
|
|
8191
8209
|
|
|
8192
8210
|
|
|
8193
8211
|
|
|
8194
|
-
|
|
8212
|
+
|
|
8213
|
+
|
|
8214
|
+
|
|
8215
|
+
|
|
8216
|
+
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.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupMoveActionInputV2 = DTODocumentationGroupMoveActionInputV2; exports.DTODocumentationGroupMoveActionOutputV2 = DTODocumentationGroupMoveActionOutputV2; exports.DTODocumentationGroupStructureV2 = DTODocumentationGroupStructureV2; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationGroupV2 = DTODocumentationGroupV2; 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.DTODocumentationTabGroupCreateActionInputV2 = DTODocumentationTabGroupCreateActionInputV2; exports.DTODocumentationTabGroupCreateActionOutputV2 = DTODocumentationTabGroupCreateActionOutputV2; exports.DTODocumentationTabGroupDeleteActionInputV2 = DTODocumentationTabGroupDeleteActionInputV2; exports.DTODocumentationTabGroupDeleteActionOutputV2 = DTODocumentationTabGroupDeleteActionOutputV2; 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;
|
|
8195
8217
|
//# sourceMappingURL=index.js.map
|