@supernova-studio/client 0.58.18 → 1.0.0-alpha.2
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 +1349 -1323
- package/dist/index.d.ts +1349 -1323
- package/dist/index.js +462 -329
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -631
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/api/client.ts +0 -31
- package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
- package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
- package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
- package/src/api/conversion/documentation/index.ts +0 -7
- package/src/api/conversion/export/index.ts +0 -1
- package/src/api/conversion/export/pipeline.ts +0 -25
- package/src/api/conversion/index.ts +0 -3
- package/src/api/conversion/integrations/git.ts +0 -37
- package/src/api/conversion/integrations/index.ts +0 -2
- package/src/api/conversion/integrations/integration.ts +0 -37
- package/src/api/dto/aux/color.ts +0 -7
- package/src/api/dto/aux/index.ts +0 -3
- package/src/api/dto/aux/meta.ts +0 -8
- package/src/api/dto/aux/pagination.ts +0 -8
- package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
- package/src/api/dto/bff/index.ts +0 -1
- package/src/api/dto/collections/index.ts +0 -1
- package/src/api/dto/collections/token-collection.ts +0 -24
- package/src/api/dto/design-systems/brand.ts +0 -44
- package/src/api/dto/design-systems/component.ts +0 -40
- package/src/api/dto/design-systems/contact.ts +0 -11
- package/src/api/dto/design-systems/data-source.ts +0 -141
- package/src/api/dto/design-systems/design-system.ts +0 -68
- package/src/api/dto/design-systems/elements-diff.ts +0 -14
- package/src/api/dto/design-systems/figma-variables.ts +0 -108
- package/src/api/dto/design-systems/import-job.ts +0 -61
- package/src/api/dto/design-systems/index.ts +0 -13
- package/src/api/dto/design-systems/members.ts +0 -50
- package/src/api/dto/design-systems/role.ts +0 -11
- package/src/api/dto/design-systems/stats.ts +0 -19
- package/src/api/dto/design-systems/version.ts +0 -56
- package/src/api/dto/design-systems/view.ts +0 -45
- package/src/api/dto/design-tokens/design-token.ts +0 -78
- package/src/api/dto/design-tokens/index.ts +0 -1
- package/src/api/dto/documentation/anchor.ts +0 -15
- package/src/api/dto/documentation/approvals.ts +0 -15
- package/src/api/dto/documentation/block-definition.ts +0 -28
- package/src/api/dto/documentation/block.ts +0 -6
- package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
- package/src/api/dto/documentation/index.ts +0 -8
- package/src/api/dto/documentation/link-preview.ts +0 -23
- package/src/api/dto/documentation/publish.ts +0 -23
- package/src/api/dto/documentation/room.ts +0 -12
- package/src/api/dto/elements/components/figma-component-group.ts +0 -19
- package/src/api/dto/elements/components/figma-component.ts +0 -56
- package/src/api/dto/elements/components/index.ts +0 -2
- package/src/api/dto/elements/documentation/draft-state.ts +0 -37
- package/src/api/dto/elements/documentation/group-action.ts +0 -108
- package/src/api/dto/elements/documentation/group-v1.ts +0 -35
- package/src/api/dto/elements/documentation/group-v2.ts +0 -117
- package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
- package/src/api/dto/elements/documentation/index.ts +0 -13
- package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
- package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
- package/src/api/dto/elements/documentation/metadata.ts +0 -8
- package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
- package/src/api/dto/elements/documentation/page-content.ts +0 -15
- package/src/api/dto/elements/documentation/page-v1.ts +0 -21
- package/src/api/dto/elements/documentation/page-v2.ts +0 -120
- package/src/api/dto/elements/documentation/structure.ts +0 -37
- package/src/api/dto/elements/elements-action-v2.ts +0 -104
- package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
- package/src/api/dto/elements/figma-nodes/index.ts +0 -2
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
- package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
- package/src/api/dto/elements/get-elements-v2.ts +0 -21
- package/src/api/dto/elements/index.ts +0 -7
- package/src/api/dto/elements/properties/index.ts +0 -2
- package/src/api/dto/elements/properties/property-definitions.ts +0 -75
- package/src/api/dto/elements/properties/property-values.ts +0 -38
- package/src/api/dto/export/exporter-property.ts +0 -95
- package/src/api/dto/export/exporter.ts +0 -87
- package/src/api/dto/export/filter.ts +0 -6
- package/src/api/dto/export/index.ts +0 -5
- package/src/api/dto/export/job.ts +0 -87
- package/src/api/dto/export/pipeline.ts +0 -43
- package/src/api/dto/figma-components/assets/download.ts +0 -30
- package/src/api/dto/figma-components/assets/index.ts +0 -1
- package/src/api/dto/figma-components/index.ts +0 -1
- package/src/api/dto/index.ts +0 -13
- package/src/api/dto/liveblocks/auth-response.ts +0 -7
- package/src/api/dto/liveblocks/index.ts +0 -1
- package/src/api/dto/themes/index.ts +0 -2
- package/src/api/dto/themes/override.ts +0 -27
- package/src/api/dto/themes/theme.ts +0 -45
- package/src/api/dto/users/authenticated-user.ts +0 -43
- package/src/api/dto/users/index.ts +0 -3
- package/src/api/dto/users/update.ts +0 -8
- package/src/api/dto/users/user.ts +0 -31
- package/src/api/dto/workspaces/git.ts +0 -32
- package/src/api/dto/workspaces/index.ts +0 -6
- package/src/api/dto/workspaces/integrations.ts +0 -34
- package/src/api/dto/workspaces/invitations.ts +0 -30
- package/src/api/dto/workspaces/membership.ts +0 -41
- package/src/api/dto/workspaces/npm-registry.ts +0 -35
- package/src/api/dto/workspaces/workspace.ts +0 -34
- package/src/api/endpoints/codegen/codegen.ts +0 -13
- package/src/api/endpoints/codegen/exporters.ts +0 -13
- package/src/api/endpoints/codegen/index.ts +0 -3
- package/src/api/endpoints/codegen/pipelines.ts +0 -37
- package/src/api/endpoints/design-system/bff.ts +0 -13
- package/src/api/endpoints/design-system/contact.ts +0 -12
- package/src/api/endpoints/design-system/design-systems.ts +0 -55
- package/src/api/endpoints/design-system/index.ts +0 -6
- package/src/api/endpoints/design-system/members.ts +0 -24
- package/src/api/endpoints/design-system/sources.ts +0 -35
- package/src/api/endpoints/design-system/versions/brands.ts +0 -45
- package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
- package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
- package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
- package/src/api/endpoints/design-system/versions/elements.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
- package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
- package/src/api/endpoints/design-system/versions/index.ts +0 -18
- package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
- package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
- package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
- package/src/api/endpoints/design-system/versions/stats.ts +0 -12
- package/src/api/endpoints/design-system/versions/themes.ts +0 -35
- package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
- package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
- package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
- package/src/api/endpoints/design-system/versions/versions.ts +0 -79
- package/src/api/endpoints/index.ts +0 -5
- package/src/api/endpoints/liveblocks.ts +0 -14
- package/src/api/endpoints/users.ts +0 -26
- package/src/api/endpoints/workspaces/index.ts +0 -3
- package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
- package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
- package/src/api/endpoints/workspaces/workspaces.ts +0 -47
- package/src/api/index.ts +0 -6
- package/src/api/payloads/design-systems/index.ts +0 -2
- package/src/api/payloads/design-systems/update-design-system.ts +0 -29
- package/src/api/payloads/design-systems/version.ts +0 -29
- package/src/api/payloads/documentation/block-definitions.ts +0 -12
- package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
- package/src/api/payloads/documentation/index.ts +0 -2
- package/src/api/payloads/export/index.ts +0 -1
- package/src/api/payloads/export/pipeline.ts +0 -50
- package/src/api/payloads/index.ts +0 -6
- package/src/api/payloads/liveblocks/auth.ts +0 -7
- package/src/api/payloads/liveblocks/index.ts +0 -1
- package/src/api/payloads/users/index.ts +0 -2
- package/src/api/payloads/users/notifications/index.ts +0 -1
- package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
- package/src/api/payloads/users/profile/index.ts +0 -1
- package/src/api/payloads/users/profile/update.ts +0 -4
- package/src/api/payloads/workspaces/index.ts +0 -3
- package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
- package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
- package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
- package/src/api/transport/index.ts +0 -2
- package/src/api/transport/request-executor-error.ts +0 -66
- package/src/api/transport/request-executor.ts +0 -87
- package/src/index.ts +0 -3
- package/src/utils/figma.ts +0 -53
- package/src/utils/hash.ts +0 -62
- package/src/utils/index.ts +0 -3
- package/src/utils/query.ts +0 -18
- package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
- package/src/yjs/design-system-content/index.ts +0 -2
- package/src/yjs/design-system-content/item-configuration.ts +0 -93
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
- package/src/yjs/docs-editor/index.ts +0 -7
- package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
- package/src/yjs/docs-editor/mock.ts +0 -2104
- package/src/yjs/docs-editor/model/block.ts +0 -8
- package/src/yjs/docs-editor/model/index.ts +0 -2
- package/src/yjs/docs-editor/model/page.ts +0 -8
- package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
- package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
- package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
- package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
- package/src/yjs/docs-editor/utils.ts +0 -115
- package/src/yjs/index.ts +0 -3
- package/src/yjs/version-room/backend.ts +0 -78
- package/src/yjs/version-room/base.ts +0 -211
- package/src/yjs/version-room/frontend.ts +0 -461
- package/src/yjs/version-room/index.ts +0 -4
- package/src/yjs/version-room/utils.ts +0 -109
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as Y from "yjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { DTODocumentationHierarchyV2 } from "../../api";
|
|
4
|
-
import { FrontendVersionRoomYDoc } from "../version-room/frontend";
|
|
5
|
-
|
|
6
|
-
// We store pages and groups in the same way they are stored in the database.
|
|
7
|
-
// This means that instead of groups having childrenIds array, all items have
|
|
8
|
-
// parentPersistentId property that points to the parent item in the tree.
|
|
9
|
-
// Upon read this gets converted to the format that client expects, which is
|
|
10
|
-
// ordered childrenIds array on all groups.
|
|
11
|
-
//
|
|
12
|
-
// The decision behind it is that we potentially want to get rid of childrenIds
|
|
13
|
-
// array entirely because it makes group updates more complicated. For now
|
|
14
|
-
// resolving it on fly is a tradeoff for not rewriting client to stop relying
|
|
15
|
-
// on children ids array.
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
// Types
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
export const DocumentationHierarchySettings = z.object({
|
|
22
|
-
routingVersion: z.string(),
|
|
23
|
-
isDraftFeatureAdopted: z.boolean(),
|
|
24
|
-
isApprovalFeatureEnabled: z.boolean(),
|
|
25
|
-
approvalRequiredForPublishing: z.boolean(),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export type DocumentationHierarchySettings = z.infer<typeof DocumentationHierarchySettings>;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated - Use FrontendVersionRoomYDoc.getDocumentationHierarchy
|
|
32
|
-
*/
|
|
33
|
-
export function yjsToDocumentationHierarchy(doc: Y.Doc): DTODocumentationHierarchyV2 {
|
|
34
|
-
return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
|
|
35
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { DocumentationItemHeaderV2 } from "@supernova-studio/model";
|
|
2
|
-
import * as Y from "yjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { DTODocumentationItemConfigurationV2 } from "../../api/dto/elements/documentation/item-configuration-v2";
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
// Types
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
export const DTODocumentationPageRoomHeaderData = z.object({
|
|
11
|
-
title: z.string(),
|
|
12
|
-
configuration: DTODocumentationItemConfigurationV2,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const DTODocumentationPageRoomHeaderDataUpdate = z.object({
|
|
16
|
-
title: z.string().optional(),
|
|
17
|
-
configuration: DTODocumentationItemConfigurationV2.omit({ header: true })
|
|
18
|
-
.extend({ header: DocumentationItemHeaderV2.partial() })
|
|
19
|
-
.optional(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export type DTODocumentationPageRoomHeaderData = z.infer<typeof DTODocumentationPageRoomHeaderData>;
|
|
23
|
-
export type DTODocumentationPageRoomHeaderDataUpdate = z.infer<typeof DTODocumentationPageRoomHeaderDataUpdate>;
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
// YJS Bindings
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
export function itemConfigurationToYjs(yDoc: Y.Doc, item: DTODocumentationPageRoomHeaderDataUpdate) {
|
|
30
|
-
yDoc.transact(trx => {
|
|
31
|
-
const { title, configuration } = item;
|
|
32
|
-
|
|
33
|
-
const header = configuration?.header;
|
|
34
|
-
|
|
35
|
-
if (title !== undefined) {
|
|
36
|
-
const headerYMap = trx.doc.getMap("itemTitle");
|
|
37
|
-
headerYMap.set("title", title);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (header) {
|
|
41
|
-
const headerYMap = trx.doc.getMap("itemHeader");
|
|
42
|
-
|
|
43
|
-
header.description !== undefined && headerYMap.set("description", header.description);
|
|
44
|
-
header.alignment !== undefined && headerYMap.set("alignment", header.alignment);
|
|
45
|
-
header.foregroundColor !== undefined && headerYMap.set("foregroundColor", header.foregroundColor);
|
|
46
|
-
header.backgroundColor !== undefined && headerYMap.set("backgroundColor", header.backgroundColor);
|
|
47
|
-
header.backgroundImageAsset !== undefined && headerYMap.set("backgroundImageAsset", header.backgroundImageAsset);
|
|
48
|
-
header.backgroundImageScaleType !== undefined &&
|
|
49
|
-
headerYMap.set("backgroundImageScaleType", header.backgroundImageScaleType);
|
|
50
|
-
header.showBackgroundOverlay !== undefined &&
|
|
51
|
-
headerYMap.set("showBackgroundOverlay", header.showBackgroundOverlay);
|
|
52
|
-
header.showCoverText !== undefined && headerYMap.set("showCoverText", header.showCoverText);
|
|
53
|
-
header.minHeight !== undefined && headerYMap.set("minHeight", header.minHeight);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
57
|
-
|
|
58
|
-
configuration?.showSidebar !== undefined && configYMap.set("showSidebar", configuration.showSidebar);
|
|
59
|
-
configuration?.isHidden !== undefined && configYMap.set("isHidden", configuration.isHidden);
|
|
60
|
-
configuration?.isPrivate !== undefined && configYMap.set("isPrivate", configuration.isPrivate);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function yjsToItemConfiguration(yDoc: Y.Doc): DTODocumentationPageRoomHeaderData {
|
|
65
|
-
const title = yDoc.getMap("itemTitle").get("title");
|
|
66
|
-
|
|
67
|
-
const headerYMap = yDoc.getMap("itemHeader");
|
|
68
|
-
const rawHeader = {
|
|
69
|
-
description: headerYMap.get("description"),
|
|
70
|
-
alignment: headerYMap.get("alignment"),
|
|
71
|
-
foregroundColor: headerYMap.get("foregroundColor"),
|
|
72
|
-
backgroundColor: headerYMap.get("backgroundColor"),
|
|
73
|
-
backgroundImageAsset: headerYMap.get("backgroundImageAsset"),
|
|
74
|
-
backgroundImageScaleType: headerYMap.get("backgroundImageScaleType"),
|
|
75
|
-
showBackgroundOverlay: headerYMap.get("showBackgroundOverlay"),
|
|
76
|
-
showCoverText: headerYMap.get("showCoverText"),
|
|
77
|
-
minHeight: headerYMap.get("minHeight"),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const configYMap = yDoc.getMap("itemConfiguration");
|
|
81
|
-
|
|
82
|
-
const rawConfig = {
|
|
83
|
-
showSidebar: configYMap.get("showSidebar"),
|
|
84
|
-
isHidden: configYMap.get("isHidden") ?? false,
|
|
85
|
-
isPrivate: configYMap.get("isPrivate") ?? false,
|
|
86
|
-
header: rawHeader,
|
|
87
|
-
} satisfies Record<keyof DTODocumentationItemConfigurationV2, unknown>;
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
title: z.string().parse(title),
|
|
91
|
-
configuration: DTODocumentationItemConfigurationV2.parse(rawConfig),
|
|
92
|
-
};
|
|
93
|
-
}
|