@supernova-studio/client 1.3.1 → 1.3.3

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.js CHANGED
@@ -307,7 +307,8 @@ var FeaturesSummary = _zod.z.object({
307
307
  approvals: featureToggleSchema,
308
308
  selectivePublishing: featureToggleSchema,
309
309
  designSystemAccessModes: featureToggleSchema,
310
- designSystemRoles: featureToggleSchema
310
+ designSystemRoles: featureToggleSchema,
311
+ documentationPageRedirects: featureToggleSchema
311
312
  });
312
313
  var InvoiceSchema = _zod.z.object({
313
314
  id: _zod.z.string(),
@@ -13633,6 +13634,7 @@ var LocalDocsElementActionExecutor = class {
13633
13634
  case "DocumentationPageRestore":
13634
13635
  throw new Error(`Transaction type ${trx.type} is not yet implemented`);
13635
13636
  case "DocumentationTabCreate":
13637
+ return this.documentationTabCreate(trx);
13636
13638
  case "DocumentationTabGroupDelete":
13637
13639
  throw new Error(`Transaction type ${trx.type} is not yet implemented`);
13638
13640
  case "FigmaNodeRender":
@@ -13787,6 +13789,40 @@ var LocalDocsElementActionExecutor = class {
13787
13789
  }
13788
13790
  }
13789
13791
  //
13792
+ // Tabs
13793
+ //
13794
+ documentationTabCreate(trx) {
13795
+ const { input } = trx;
13796
+ const page = this.pages.get(input.fromItemPersistentId);
13797
+ if (!page) {
13798
+ throw new Error(`Cannot create tab: page id ${input.fromItemPersistentId} was not found`);
13799
+ }
13800
+ const tabGroup = {
13801
+ parentPersistentId: page.parentPersistentId,
13802
+ persistentId: input.persistentId,
13803
+ shortPersistentId: generateShortPersistentId(),
13804
+ slug: page.slug,
13805
+ meta: page.meta,
13806
+ createdAt: /* @__PURE__ */ new Date(),
13807
+ updatedAt: /* @__PURE__ */ new Date(),
13808
+ data: {
13809
+ behavior: "Tabs",
13810
+ configuration: _optionalChain([page, 'optionalAccess', _90 => _90.data, 'access', _91 => _91.configuration])
13811
+ },
13812
+ sortOrder: page.sortOrder,
13813
+ designSystemVersionId: this.designSystemVersionId
13814
+ };
13815
+ this.groups.set(input.persistentId, tabGroup);
13816
+ const newLocalPage = {
13817
+ ...page,
13818
+ userSlug: void 0,
13819
+ sortOrder: 0,
13820
+ parentPersistentId: input.persistentId,
13821
+ meta: { name: input.tabName }
13822
+ };
13823
+ this.pages.set(newLocalPage.persistentId, newLocalPage);
13824
+ }
13825
+ //
13790
13826
  // Approval states
13791
13827
  //
13792
13828
  documentationApprovalStateUpdate(trx) {
@@ -13795,7 +13831,7 @@ var LocalDocsElementActionExecutor = class {
13795
13831
  if (input.approvalState) {
13796
13832
  this.approvalStates.set(input.persistentId, {
13797
13833
  approvalState: input.approvalState,
13798
- createdAt: _nullishCoalesce(_optionalChain([existingApproval, 'optionalAccess', _90 => _90.createdAt]), () => ( /* @__PURE__ */ new Date())),
13834
+ createdAt: _nullishCoalesce(_optionalChain([existingApproval, 'optionalAccess', _92 => _92.createdAt]), () => ( /* @__PURE__ */ new Date())),
13799
13835
  designSystemVersionId: this.designSystemVersionId,
13800
13836
  pagePersistentId: input.persistentId,
13801
13837
  updatedAt: /* @__PURE__ */ new Date(),
@@ -13826,7 +13862,7 @@ var LocalDocsElementActionExecutor = class {
13826
13862
  return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13827
13863
  }
13828
13864
  const left = neighbours[index].sortOrder;
13829
- const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _91 => _91[index + 1], 'optionalAccess', _92 => _92.sortOrder]), () => ( left + sortOrderStep * 2));
13865
+ const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _93 => _93[index + 1], 'optionalAccess', _94 => _94.sortOrder]), () => ( left + sortOrderStep * 2));
13830
13866
  return (right + left) / 2;
13831
13867
  }
13832
13868
  };