@supernova-studio/client 0.12.0 → 0.14.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 +2057 -34
- package/dist/index.d.ts +2057 -34
- package/dist/index.js +38 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1166 -1148
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/requests/elements/elements-transaction-v2.ts +53 -0
- package/src/api/requests/elements/index.ts +1 -0
- package/src/api/requests/index.ts +1 -1
- package/src/api/responses/elements/elements-transaction-v2.ts +11 -0
- package/src/api/responses/elements/index.ts +1 -0
- package/src/api/responses/index.ts +1 -0
- package/src/design-system-content/documentation-hierarchy.ts +39 -6
- package/src/design-system-content/item-configuration.ts +1 -1
- package/src/api/requests/post-bulk-doc-page-elements.ts +0 -47
package/dist/index.js
CHANGED
|
@@ -119,6 +119,9 @@ var _zod = require('zod');
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
|
|
@@ -882,7 +885,10 @@ var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
|
882
885
|
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
883
886
|
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
884
887
|
var PageBlockThemeDisplayMode = _zod.z.enum(["Split", "Override"]);
|
|
885
|
-
var PageBlockColorV2 = _zod.z.
|
|
888
|
+
var PageBlockColorV2 = _zod.z.object({
|
|
889
|
+
value: _zod.z.string(),
|
|
890
|
+
referencedTokenId: _zod.z.string().optional()
|
|
891
|
+
});
|
|
886
892
|
var PageBlockAppearanceV2 = _zod.z.object({
|
|
887
893
|
itemBackgroundColor: PageBlockColorV2.optional(),
|
|
888
894
|
numberOfColumns: _zod.z.number().optional()
|
|
@@ -2729,36 +2735,36 @@ var DocumentationHierarchyV2DTO = _zod.z.object({
|
|
|
2729
2735
|
groups: _zod.z.array(DocumentationGroupStructureDTO)
|
|
2730
2736
|
});
|
|
2731
2737
|
|
|
2732
|
-
// src/api/requests/
|
|
2738
|
+
// src/api/requests/elements/elements-transaction-v2.ts
|
|
2733
2739
|
|
|
2734
|
-
var
|
|
2740
|
+
var DTOCreateDocumentationPageInput = _zod.z.object({
|
|
2735
2741
|
parentPersistentId: _zod.z.string().uuid(),
|
|
2736
2742
|
persistentId: _zod.z.string().uuid(),
|
|
2737
2743
|
title: _zod.z.string(),
|
|
2738
2744
|
configuration: DocumentationItemConfiguration.optional(),
|
|
2739
2745
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2740
2746
|
});
|
|
2741
|
-
var
|
|
2747
|
+
var DTOUpdateDocumentationPageInput = _zod.z.object({
|
|
2742
2748
|
id: _zod.z.string(),
|
|
2743
2749
|
title: _zod.z.string().optional(),
|
|
2744
2750
|
configuration: DocumentationItemConfiguration.optional(),
|
|
2745
2751
|
parentPersistentId: _zod.z.string().optional(),
|
|
2746
2752
|
afterPersistentId: _zod.z.string().optional()
|
|
2747
2753
|
});
|
|
2748
|
-
var
|
|
2749
|
-
var DuplicateBulkElementsInput = _zod.z.object({
|
|
2754
|
+
var DTODuplicateDocumentationPageInput = _zod.z.object({
|
|
2750
2755
|
id: _zod.z.string(),
|
|
2751
2756
|
persistentId: _zod.z.string().uuid(),
|
|
2752
2757
|
parentPersistentId: _zod.z.string().uuid(),
|
|
2753
2758
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2754
2759
|
});
|
|
2755
|
-
var
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2760
|
+
var DTODocumentationTransactionInput = _zod.z.object({
|
|
2761
|
+
create: _zod.z.array(DTOCreateDocumentationPageInput).optional(),
|
|
2762
|
+
update: _zod.z.array(DTOUpdateDocumentationPageInput).optional(),
|
|
2763
|
+
duplicate: _zod.z.array(DTODuplicateDocumentationPageInput).optional(),
|
|
2764
|
+
delete: _zod.z.array(_zod.z.string()).optional()
|
|
2765
|
+
});
|
|
2766
|
+
var DTOElementsTransactionInput = _zod.z.object({
|
|
2767
|
+
documentationPages: DTODocumentationTransactionInput
|
|
2762
2768
|
});
|
|
2763
2769
|
|
|
2764
2770
|
// src/api/requests/post-liveblocks-auth.ts
|
|
@@ -2774,13 +2780,19 @@ var GetBlockDefinitionsResponse = _zod.z.object({
|
|
|
2774
2780
|
});
|
|
2775
2781
|
|
|
2776
2782
|
// src/design-system-content/documentation-hierarchy.ts
|
|
2777
|
-
function documentationHierarchyToYjs(documentationHierarchy,
|
|
2783
|
+
function documentationHierarchyToYjs(doc, documentationHierarchy, itemsToDelete) {
|
|
2778
2784
|
doc.transact((trx) => {
|
|
2779
|
-
const pagesMap = trx.doc
|
|
2785
|
+
const pagesMap = getPagesYMap(trx.doc);
|
|
2786
|
+
itemsToDelete.pagePersistentIdsToDelete.forEach((persistentId) => {
|
|
2787
|
+
pagesMap.delete(persistentId);
|
|
2788
|
+
});
|
|
2780
2789
|
documentationHierarchy.pages.forEach((page) => {
|
|
2781
2790
|
pagesMap.set(page.persistentId, page);
|
|
2782
2791
|
});
|
|
2783
|
-
const groupsMap = trx.doc
|
|
2792
|
+
const groupsMap = getGroupsYMap(trx.doc);
|
|
2793
|
+
itemsToDelete.groupPersistentIdsToDelete.forEach((persistentId) => {
|
|
2794
|
+
groupsMap.delete(persistentId);
|
|
2795
|
+
});
|
|
2784
2796
|
documentationHierarchy.groups.forEach((group) => {
|
|
2785
2797
|
groupsMap.set(group.persistentId, group);
|
|
2786
2798
|
});
|
|
@@ -2788,8 +2800,8 @@ function documentationHierarchyToYjs(documentationHierarchy, doc) {
|
|
|
2788
2800
|
return doc;
|
|
2789
2801
|
}
|
|
2790
2802
|
function yjsToDocumentationHierarchy(doc) {
|
|
2791
|
-
const pagesMap = doc
|
|
2792
|
-
const groupsMap = doc
|
|
2803
|
+
const pagesMap = getPagesYMap(doc);
|
|
2804
|
+
const groupsMap = getGroupsYMap(doc);
|
|
2793
2805
|
const pages = [];
|
|
2794
2806
|
pagesMap.forEach((page) => {
|
|
2795
2807
|
pages.push(DocumentationPageStructureV2DTO.parse(page));
|
|
@@ -2803,9 +2815,15 @@ function yjsToDocumentationHierarchy(doc) {
|
|
|
2803
2815
|
groups
|
|
2804
2816
|
};
|
|
2805
2817
|
}
|
|
2818
|
+
function getPagesYMap(doc) {
|
|
2819
|
+
return doc.getMap("documentationPages");
|
|
2820
|
+
}
|
|
2821
|
+
function getGroupsYMap(doc) {
|
|
2822
|
+
return doc.getMap("documentationGroups");
|
|
2823
|
+
}
|
|
2806
2824
|
|
|
2807
2825
|
// src/design-system-content/item-configuration.ts
|
|
2808
|
-
function itemConfigurationToYjs(
|
|
2826
|
+
function itemConfigurationToYjs(yDoc, item) {
|
|
2809
2827
|
yDoc.transact((trx) => {
|
|
2810
2828
|
const header = item.header;
|
|
2811
2829
|
if (header) {
|
|
@@ -7005,5 +7023,5 @@ function mapByUnique(items, keyFn) {
|
|
|
7005
7023
|
|
|
7006
7024
|
|
|
7007
7025
|
|
|
7008
|
-
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.
|
|
7026
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationPageInput = DTOCreateDocumentationPageInput; exports.DTODocumentationTransactionInput = DTODocumentationTransactionInput; exports.DTODuplicateDocumentationPageInput = DTODuplicateDocumentationPageInput; exports.DTOElementsTransactionInput = DTOElementsTransactionInput; exports.DTOUpdateDocumentationPageInput = DTOUpdateDocumentationPageInput; exports.DesignSystemDTO = DesignSystemDTO; exports.DocumentationGroupDTO = DocumentationGroupDTO; exports.DocumentationGroupStructureDTO = DocumentationGroupStructureDTO; exports.DocumentationHierarchyV2DTO = DocumentationHierarchyV2DTO; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageStructureV2DTO = DocumentationPageStructureV2DTO; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.DocumentationPageV2DTO = DocumentationPageV2DTO; exports.GetBlockDefinitionsResponse = GetBlockDefinitionsResponse; exports.PageBlockEditorModel = PageBlockEditorModel; exports.PostLiveblocksAuth = PostLiveblocksAuth; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; 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;
|
|
7009
7027
|
//# sourceMappingURL=index.js.map
|