@supernova-studio/client 0.47.69 → 0.47.71

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.mjs CHANGED
@@ -1274,13 +1274,13 @@ var DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTyp
1274
1274
  var DocumentationItemHeaderV1 = z41.object({
1275
1275
  description: z41.string(),
1276
1276
  alignment: DocumentationItemHeaderAlignmentSchema,
1277
- foregroundColor: ColorTokenData.nullish(),
1278
- backgroundColor: ColorTokenData.nullish(),
1279
- backgroundImageAsset: PageBlockAsset.nullish(),
1277
+ foregroundColor: nullishToOptional(ColorTokenData),
1278
+ backgroundColor: nullishToOptional(ColorTokenData),
1279
+ backgroundImageAsset: nullishToOptional(PageBlockAsset),
1280
1280
  backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
1281
1281
  showBackgroundOverlay: z41.boolean(),
1282
1282
  showCoverText: z41.boolean(),
1283
- minHeight: z41.number().nullish()
1283
+ minHeight: nullishToOptional(z41.number())
1284
1284
  });
1285
1285
  var defaultDocumentationItemHeaderV1 = {
1286
1286
  alignment: DocumentationItemHeaderAlignment.Left,
@@ -1302,13 +1302,13 @@ var DocumentationPageDataV1 = z43.object({
1302
1302
  var DocumentationItemHeaderV2 = z44.object({
1303
1303
  description: z44.string(),
1304
1304
  alignment: DocumentationItemHeaderAlignmentSchema,
1305
- foregroundColor: PageBlockColorV2.nullish(),
1306
- backgroundColor: PageBlockColorV2.nullish(),
1307
- backgroundImageAsset: PageBlockImageReference.nullish(),
1305
+ foregroundColor: nullishToOptional(PageBlockColorV2),
1306
+ backgroundColor: nullishToOptional(PageBlockColorV2),
1307
+ backgroundImageAsset: nullishToOptional(PageBlockImageReference),
1308
1308
  backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
1309
1309
  showBackgroundOverlay: z44.boolean(),
1310
1310
  showCoverText: z44.boolean(),
1311
- minHeight: z44.number().nullish()
1311
+ minHeight: nullishToOptional(z44.number())
1312
1312
  });
1313
1313
  var defaultDocumentationItemHeaderV2 = {
1314
1314
  alignment: DocumentationItemHeaderAlignment.Left,
@@ -2865,7 +2865,8 @@ var DesignSystemVersionRoomUpdate = z123.object({
2865
2865
  pageSnapshots: z123.array(DocumentationPageSnapshot),
2866
2866
  groupSnapshots: z123.array(ElementGroupSnapshot),
2867
2867
  pageSnapshotIdsToDelete: z123.array(z123.string()),
2868
- groupSnapshotIdsToDelete: z123.array(z123.string())
2868
+ groupSnapshotIdsToDelete: z123.array(z123.string()),
2869
+ pageHashesToUpdate: z123.record(z123.string(), z123.string())
2869
2870
  });
2870
2871
  var DocumentationPageRoom = Entity.extend({
2871
2872
  designSystemVersionId: z124.string(),
@@ -2885,6 +2886,17 @@ var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.ex
2885
2886
  pageItems: z124.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
2886
2887
  blockDefinitions: z124.array(PageBlockDefinition)
2887
2888
  });
2889
+ var RestoredDocumentationPage = z124.object({
2890
+ page: DocumentationPageV2,
2891
+ pageParent: ElementGroup,
2892
+ pageContent: DocumentationPageContentData,
2893
+ contentHash: z124.string(),
2894
+ roomId: z124.string().optional()
2895
+ });
2896
+ var RestoredDocumentationGroup = z124.object({
2897
+ group: ElementGroup,
2898
+ parent: ElementGroup
2899
+ });
2888
2900
  var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
2889
2901
  RoomTypeEnum2["DocumentationPage"] = "documentation-page";
2890
2902
  RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
@@ -5093,6 +5105,14 @@ var DTODeleteDocumentationPageInputV2 = z184.object({
5093
5105
  // Identifier
5094
5106
  id: z184.string()
5095
5107
  });
5108
+ var DTORestoreDocumentationPageInput = z184.object({
5109
+ persistentId: z184.string(),
5110
+ snapshotId: z184.string().optional()
5111
+ });
5112
+ var DTORestoreDocumentationGroupInput = z184.object({
5113
+ persistentId: z184.string(),
5114
+ snapshotId: z184.string().optional()
5115
+ });
5096
5116
 
5097
5117
  // src/api/dto/documentation/documentation-page-snapshot.ts
5098
5118
  var DTODocumentationPageSnapshot = z185.object({
@@ -5471,6 +5491,14 @@ var DTODocumentationPageDeleteActionOutputV2 = z196.object({
5471
5491
  type: z196.literal("DocumentationPageDelete"),
5472
5492
  output: SuccessPayload2
5473
5493
  });
5494
+ var DTODocumentationPageRestoreActionOutput = z196.object({
5495
+ type: z196.literal("DocumentationPageRestore"),
5496
+ output: SuccessPayload2
5497
+ });
5498
+ var DTODocumentationGroupRestoreActionOutput = z196.object({
5499
+ type: z196.literal("DocumentationGroupRestore"),
5500
+ output: SuccessPayload2
5501
+ });
5474
5502
  var DTODocumentationPageCreateActionInputV2 = z196.object({
5475
5503
  type: z196.literal("DocumentationPageCreate"),
5476
5504
  input: DTOCreateDocumentationPageInputV2
@@ -5491,6 +5519,14 @@ var DTODocumentationPageDeleteActionInputV2 = z196.object({
5491
5519
  type: z196.literal("DocumentationPageDelete"),
5492
5520
  input: DTODeleteDocumentationPageInputV2
5493
5521
  });
5522
+ var DTODocumentationPageRestoreActionInput = z196.object({
5523
+ type: z196.literal("DocumentationPageRestore"),
5524
+ input: DTORestoreDocumentationPageInput
5525
+ });
5526
+ var DTODocumentationGroupRestoreActionInput = z196.object({
5527
+ type: z196.literal("DocumentationGroupRestore"),
5528
+ input: DTORestoreDocumentationGroupInput
5529
+ });
5494
5530
 
5495
5531
  // src/api/dto/elements/documentation/page-content.ts
5496
5532
  import { z as z197 } from "zod";
@@ -5658,7 +5694,10 @@ var DTOElementActionOutput = z204.discriminatedUnion("type", [
5658
5694
  // Properties Definitions
5659
5695
  DTOPropertyDefinitionCreateActionOutputV2,
5660
5696
  DTOPropertyDefinitionUpdateActionOutputV2,
5661
- DTOPropertyDefinitionDeleteActionOutputV2
5697
+ DTOPropertyDefinitionDeleteActionOutputV2,
5698
+ // Restore
5699
+ DTODocumentationPageRestoreActionOutput,
5700
+ DTODocumentationGroupRestoreActionOutput
5662
5701
  ]);
5663
5702
  var DTOElementActionInput = z204.discriminatedUnion("type", [
5664
5703
  // Documentation pages
@@ -5680,7 +5719,10 @@ var DTOElementActionInput = z204.discriminatedUnion("type", [
5680
5719
  // Properties Definitions
5681
5720
  DTOPropertyDefinitionCreateActionInputV2,
5682
5721
  DTOPropertyDefinitionUpdateActionInputV2,
5683
- DTOPropertyDefinitionDeleteActionInputV2
5722
+ DTOPropertyDefinitionDeleteActionInputV2,
5723
+ // Restore
5724
+ DTODocumentationPageRestoreActionInput,
5725
+ DTODocumentationGroupRestoreActionInput
5684
5726
  ]);
5685
5727
 
5686
5728
  // src/api/dto/elements/get-elements-v2.ts
@@ -5893,9 +5935,6 @@ function generateHash(input, debug = false) {
5893
5935
  // src/yjs/design-system-content/documentation-hierarchy.ts
5894
5936
  import { z as z214 } from "zod";
5895
5937
 
5896
- // src/yjs/version-room/frontend.ts
5897
- import deepEqual from "deep-equal";
5898
-
5899
5938
  // src/yjs/version-room/base.ts
5900
5939
  var VersionRoomBaseYDoc = class {
5901
5940
  constructor(yDoc) {
@@ -6177,7 +6216,9 @@ var FrontendVersionRoomYDoc = class {
6177
6216
  }
6178
6217
  updatedDraftState.changes.previousTitle = publishedState.title;
6179
6218
  }
6180
- if (!deepEqual(currentState.configuration, publishedState.configuration)) {
6219
+ const currentStateConfigHash = currentState.configuration ? generateHash(currentState.configuration) : "default";
6220
+ const publishedStateConfigHash = publishedState.configuration ? generateHash(publishedState.configuration) : "default";
6221
+ if (currentStateConfigHash !== publishedStateConfigHash) {
6181
6222
  if (this.debug) {
6182
6223
  console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
6183
6224
  }
@@ -7123,6 +7164,9 @@ var ListTreeBuilder = class {
7123
7164
  };
7124
7165
 
7125
7166
  // src/yjs/docs-editor/blocks-to-prosemirror.ts
7167
+ function pageToYDoc(doc, page, definitions) {
7168
+ pageToYXmlFragment(page, definitions, doc.getXmlFragment("default"));
7169
+ }
7126
7170
  function pageToYXmlFragment(page, definitions, fragment) {
7127
7171
  const doc = pageToProsemirrorDoc(page, definitions);
7128
7172
  return prosemirrorJSONToYXmlFragment(pmSchema, doc, fragment);
@@ -10683,6 +10727,7 @@ var BackendVersionRoomYDoc = class {
10683
10727
  transaction.groupSnapshotIdsToDelete && yDoc.deleteGroupSnapshots(transaction.groupSnapshotIdsToDelete);
10684
10728
  transaction.groupSnapshots && yDoc.updateGroupSnapshots(transaction.groupSnapshots);
10685
10729
  transaction.internalSettings && yDoc.updateDocumentationInternalSettings(transaction.internalSettings);
10730
+ transaction.pageHashesToUpdate && yDoc.updateDocumentationPageContentHashes(transaction.pageHashesToUpdate);
10686
10731
  });
10687
10732
  }
10688
10733
  };
@@ -10734,6 +10779,8 @@ export {
10734
10779
  DTODocumentationGroupDuplicateActionOutputV2,
10735
10780
  DTODocumentationGroupMoveActionInputV2,
10736
10781
  DTODocumentationGroupMoveActionOutputV2,
10782
+ DTODocumentationGroupRestoreActionInput,
10783
+ DTODocumentationGroupRestoreActionOutput,
10737
10784
  DTODocumentationGroupStructureV1,
10738
10785
  DTODocumentationGroupUpdateActionInputV2,
10739
10786
  DTODocumentationGroupUpdateActionOutputV2,
@@ -10756,6 +10803,8 @@ export {
10756
10803
  DTODocumentationPageDuplicateActionOutputV2,
10757
10804
  DTODocumentationPageMoveActionInputV2,
10758
10805
  DTODocumentationPageMoveActionOutputV2,
10806
+ DTODocumentationPageRestoreActionInput,
10807
+ DTODocumentationPageRestoreActionOutput,
10759
10808
  DTODocumentationPageRoomHeaderData,
10760
10809
  DTODocumentationPageRoomHeaderDataUpdate,
10761
10810
  DTODocumentationPageSnapshot,
@@ -10840,6 +10889,8 @@ export {
10840
10889
  DTOPublishDocumentationRequest,
10841
10890
  DTOPublishDocumentationResponse,
10842
10891
  DTORenderedAssetFile,
10892
+ DTORestoreDocumentationGroupInput,
10893
+ DTORestoreDocumentationPageInput,
10843
10894
  DTOUpdateDocumentationGroupInput,
10844
10895
  DTOUpdateDocumentationPageInputV2,
10845
10896
  DTOUpdateElementPropertyDefinitionInputV2,
@@ -10896,6 +10947,7 @@ export {
10896
10947
  integrationToDto,
10897
10948
  itemConfigurationToYjs,
10898
10949
  pageToProsemirrorDoc,
10950
+ pageToYDoc,
10899
10951
  pageToYXmlFragment,
10900
10952
  pipelineToDto,
10901
10953
  pmSchema,