@supernova-studio/client 0.13.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 +1981 -18
- package/dist/index.d.ts +1981 -18
- package/dist/index.js +34 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1166 -1151
- 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
|
|
|
@@ -2732,36 +2735,36 @@ var DocumentationHierarchyV2DTO = _zod.z.object({
|
|
|
2732
2735
|
groups: _zod.z.array(DocumentationGroupStructureDTO)
|
|
2733
2736
|
});
|
|
2734
2737
|
|
|
2735
|
-
// src/api/requests/
|
|
2738
|
+
// src/api/requests/elements/elements-transaction-v2.ts
|
|
2736
2739
|
|
|
2737
|
-
var
|
|
2740
|
+
var DTOCreateDocumentationPageInput = _zod.z.object({
|
|
2738
2741
|
parentPersistentId: _zod.z.string().uuid(),
|
|
2739
2742
|
persistentId: _zod.z.string().uuid(),
|
|
2740
2743
|
title: _zod.z.string(),
|
|
2741
2744
|
configuration: DocumentationItemConfiguration.optional(),
|
|
2742
2745
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2743
2746
|
});
|
|
2744
|
-
var
|
|
2747
|
+
var DTOUpdateDocumentationPageInput = _zod.z.object({
|
|
2745
2748
|
id: _zod.z.string(),
|
|
2746
2749
|
title: _zod.z.string().optional(),
|
|
2747
2750
|
configuration: DocumentationItemConfiguration.optional(),
|
|
2748
2751
|
parentPersistentId: _zod.z.string().optional(),
|
|
2749
2752
|
afterPersistentId: _zod.z.string().optional()
|
|
2750
2753
|
});
|
|
2751
|
-
var
|
|
2752
|
-
var DuplicateBulkElementsInput = _zod.z.object({
|
|
2754
|
+
var DTODuplicateDocumentationPageInput = _zod.z.object({
|
|
2753
2755
|
id: _zod.z.string(),
|
|
2754
2756
|
persistentId: _zod.z.string().uuid(),
|
|
2755
2757
|
parentPersistentId: _zod.z.string().uuid(),
|
|
2756
2758
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2757
2759
|
});
|
|
2758
|
-
var
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
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
|
|
2765
2768
|
});
|
|
2766
2769
|
|
|
2767
2770
|
// src/api/requests/post-liveblocks-auth.ts
|
|
@@ -2777,13 +2780,19 @@ var GetBlockDefinitionsResponse = _zod.z.object({
|
|
|
2777
2780
|
});
|
|
2778
2781
|
|
|
2779
2782
|
// src/design-system-content/documentation-hierarchy.ts
|
|
2780
|
-
function documentationHierarchyToYjs(documentationHierarchy,
|
|
2783
|
+
function documentationHierarchyToYjs(doc, documentationHierarchy, itemsToDelete) {
|
|
2781
2784
|
doc.transact((trx) => {
|
|
2782
|
-
const pagesMap = trx.doc
|
|
2785
|
+
const pagesMap = getPagesYMap(trx.doc);
|
|
2786
|
+
itemsToDelete.pagePersistentIdsToDelete.forEach((persistentId) => {
|
|
2787
|
+
pagesMap.delete(persistentId);
|
|
2788
|
+
});
|
|
2783
2789
|
documentationHierarchy.pages.forEach((page) => {
|
|
2784
2790
|
pagesMap.set(page.persistentId, page);
|
|
2785
2791
|
});
|
|
2786
|
-
const groupsMap = trx.doc
|
|
2792
|
+
const groupsMap = getGroupsYMap(trx.doc);
|
|
2793
|
+
itemsToDelete.groupPersistentIdsToDelete.forEach((persistentId) => {
|
|
2794
|
+
groupsMap.delete(persistentId);
|
|
2795
|
+
});
|
|
2787
2796
|
documentationHierarchy.groups.forEach((group) => {
|
|
2788
2797
|
groupsMap.set(group.persistentId, group);
|
|
2789
2798
|
});
|
|
@@ -2791,8 +2800,8 @@ function documentationHierarchyToYjs(documentationHierarchy, doc) {
|
|
|
2791
2800
|
return doc;
|
|
2792
2801
|
}
|
|
2793
2802
|
function yjsToDocumentationHierarchy(doc) {
|
|
2794
|
-
const pagesMap = doc
|
|
2795
|
-
const groupsMap = doc
|
|
2803
|
+
const pagesMap = getPagesYMap(doc);
|
|
2804
|
+
const groupsMap = getGroupsYMap(doc);
|
|
2796
2805
|
const pages = [];
|
|
2797
2806
|
pagesMap.forEach((page) => {
|
|
2798
2807
|
pages.push(DocumentationPageStructureV2DTO.parse(page));
|
|
@@ -2806,9 +2815,15 @@ function yjsToDocumentationHierarchy(doc) {
|
|
|
2806
2815
|
groups
|
|
2807
2816
|
};
|
|
2808
2817
|
}
|
|
2818
|
+
function getPagesYMap(doc) {
|
|
2819
|
+
return doc.getMap("documentationPages");
|
|
2820
|
+
}
|
|
2821
|
+
function getGroupsYMap(doc) {
|
|
2822
|
+
return doc.getMap("documentationGroups");
|
|
2823
|
+
}
|
|
2809
2824
|
|
|
2810
2825
|
// src/design-system-content/item-configuration.ts
|
|
2811
|
-
function itemConfigurationToYjs(
|
|
2826
|
+
function itemConfigurationToYjs(yDoc, item) {
|
|
2812
2827
|
yDoc.transact((trx) => {
|
|
2813
2828
|
const header = item.header;
|
|
2814
2829
|
if (header) {
|
|
@@ -7008,5 +7023,5 @@ function mapByUnique(items, keyFn) {
|
|
|
7008
7023
|
|
|
7009
7024
|
|
|
7010
7025
|
|
|
7011
|
-
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;
|
|
7012
7027
|
//# sourceMappingURL=index.js.map
|