@supernova-studio/client 0.59.12 → 1.0.0-alpha.11

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.
Files changed (204) hide show
  1. package/dist/index.d.mts +1592 -1952
  2. package/dist/index.d.ts +1592 -1952
  3. package/dist/index.js +865 -392
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2569 -2096
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/api/client.ts +0 -31
  9. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
  10. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
  11. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
  12. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
  13. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
  14. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
  15. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -78
  16. package/src/api/conversion/documentation/index.ts +0 -7
  17. package/src/api/conversion/export/index.ts +0 -1
  18. package/src/api/conversion/export/pipeline.ts +0 -26
  19. package/src/api/conversion/index.ts +0 -3
  20. package/src/api/conversion/integrations/git.ts +0 -37
  21. package/src/api/conversion/integrations/index.ts +0 -2
  22. package/src/api/conversion/integrations/integration.ts +0 -37
  23. package/src/api/dto/aux/color.ts +0 -7
  24. package/src/api/dto/aux/index.ts +0 -3
  25. package/src/api/dto/aux/meta.ts +0 -8
  26. package/src/api/dto/aux/pagination.ts +0 -8
  27. package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
  28. package/src/api/dto/bff/index.ts +0 -1
  29. package/src/api/dto/collections/index.ts +0 -1
  30. package/src/api/dto/collections/token-collection.ts +0 -24
  31. package/src/api/dto/design-systems/brand.ts +0 -44
  32. package/src/api/dto/design-systems/component.ts +0 -40
  33. package/src/api/dto/design-systems/contact.ts +0 -11
  34. package/src/api/dto/design-systems/data-source.ts +0 -141
  35. package/src/api/dto/design-systems/design-system.ts +0 -68
  36. package/src/api/dto/design-systems/elements-diff.ts +0 -14
  37. package/src/api/dto/design-systems/figma-variables.ts +0 -108
  38. package/src/api/dto/design-systems/import-job.ts +0 -61
  39. package/src/api/dto/design-systems/index.ts +0 -15
  40. package/src/api/dto/design-systems/members.ts +0 -50
  41. package/src/api/dto/design-systems/redirects.ts +0 -33
  42. package/src/api/dto/design-systems/role.ts +0 -11
  43. package/src/api/dto/design-systems/stats.ts +0 -19
  44. package/src/api/dto/design-systems/version-room.ts +0 -12
  45. package/src/api/dto/design-systems/version.ts +0 -56
  46. package/src/api/dto/design-systems/view.ts +0 -45
  47. package/src/api/dto/design-tokens/design-token.ts +0 -78
  48. package/src/api/dto/design-tokens/index.ts +0 -1
  49. package/src/api/dto/documentation/anchor.ts +0 -15
  50. package/src/api/dto/documentation/approvals.ts +0 -15
  51. package/src/api/dto/documentation/block-definition.ts +0 -28
  52. package/src/api/dto/documentation/block.ts +0 -6
  53. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  54. package/src/api/dto/documentation/index.ts +0 -8
  55. package/src/api/dto/documentation/link-preview.ts +0 -23
  56. package/src/api/dto/documentation/publish.ts +0 -23
  57. package/src/api/dto/documentation/room.ts +0 -12
  58. package/src/api/dto/elements/components/figma-component-group.ts +0 -19
  59. package/src/api/dto/elements/components/figma-component.ts +0 -56
  60. package/src/api/dto/elements/components/index.ts +0 -2
  61. package/src/api/dto/elements/documentation/draft-state.ts +0 -37
  62. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  63. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  64. package/src/api/dto/elements/documentation/group-v2.ts +0 -117
  65. package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
  66. package/src/api/dto/elements/documentation/index.ts +0 -13
  67. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  68. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  69. package/src/api/dto/elements/documentation/metadata.ts +0 -8
  70. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
  71. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  72. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  73. package/src/api/dto/elements/documentation/page-v2.ts +0 -123
  74. package/src/api/dto/elements/documentation/structure.ts +0 -37
  75. package/src/api/dto/elements/elements-action-v2.ts +0 -117
  76. package/src/api/dto/elements/figma-nodes/figma-node-v1.ts +0 -32
  77. package/src/api/dto/elements/figma-nodes/figma-node-v2.ts +0 -32
  78. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -103
  79. package/src/api/dto/elements/figma-nodes/index.ts +0 -4
  80. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -44
  81. package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
  82. package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
  83. package/src/api/dto/elements/get-elements-v2.ts +0 -27
  84. package/src/api/dto/elements/index.ts +0 -7
  85. package/src/api/dto/elements/properties/index.ts +0 -2
  86. package/src/api/dto/elements/properties/property-definitions.ts +0 -75
  87. package/src/api/dto/elements/properties/property-values.ts +0 -38
  88. package/src/api/dto/export/exporter-property.ts +0 -105
  89. package/src/api/dto/export/exporter.ts +0 -87
  90. package/src/api/dto/export/filter.ts +0 -6
  91. package/src/api/dto/export/index.ts +0 -5
  92. package/src/api/dto/export/job.ts +0 -96
  93. package/src/api/dto/export/pipeline.ts +0 -43
  94. package/src/api/dto/figma-components/assets/download.ts +0 -30
  95. package/src/api/dto/figma-components/assets/index.ts +0 -1
  96. package/src/api/dto/figma-components/index.ts +0 -1
  97. package/src/api/dto/index.ts +0 -13
  98. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  99. package/src/api/dto/liveblocks/index.ts +0 -1
  100. package/src/api/dto/themes/index.ts +0 -2
  101. package/src/api/dto/themes/override.ts +0 -27
  102. package/src/api/dto/themes/theme.ts +0 -45
  103. package/src/api/dto/users/authenticated-user.ts +0 -46
  104. package/src/api/dto/users/index.ts +0 -3
  105. package/src/api/dto/users/update.ts +0 -8
  106. package/src/api/dto/users/user.ts +0 -31
  107. package/src/api/dto/workspaces/git.ts +0 -32
  108. package/src/api/dto/workspaces/index.ts +0 -6
  109. package/src/api/dto/workspaces/integrations.ts +0 -34
  110. package/src/api/dto/workspaces/invitations.ts +0 -30
  111. package/src/api/dto/workspaces/membership.ts +0 -41
  112. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  113. package/src/api/dto/workspaces/workspace.ts +0 -34
  114. package/src/api/endpoints/codegen/codegen.ts +0 -16
  115. package/src/api/endpoints/codegen/exporters.ts +0 -25
  116. package/src/api/endpoints/codegen/index.ts +0 -4
  117. package/src/api/endpoints/codegen/jobs.ts +0 -15
  118. package/src/api/endpoints/codegen/pipelines.ts +0 -44
  119. package/src/api/endpoints/design-system/bff.ts +0 -13
  120. package/src/api/endpoints/design-system/contact.ts +0 -12
  121. package/src/api/endpoints/design-system/design-systems.ts +0 -55
  122. package/src/api/endpoints/design-system/index.ts +0 -6
  123. package/src/api/endpoints/design-system/members.ts +0 -24
  124. package/src/api/endpoints/design-system/sources.ts +0 -35
  125. package/src/api/endpoints/design-system/versions/brands.ts +0 -45
  126. package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
  127. package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
  128. package/src/api/endpoints/design-system/versions/elements-action.ts +0 -63
  129. package/src/api/endpoints/design-system/versions/elements.ts +0 -27
  130. package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
  131. package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
  132. package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
  133. package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
  134. package/src/api/endpoints/design-system/versions/index.ts +0 -18
  135. package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
  136. package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
  137. package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
  138. package/src/api/endpoints/design-system/versions/stats.ts +0 -12
  139. package/src/api/endpoints/design-system/versions/themes.ts +0 -35
  140. package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
  141. package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
  142. package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
  143. package/src/api/endpoints/design-system/versions/versions.ts +0 -87
  144. package/src/api/endpoints/index.ts +0 -5
  145. package/src/api/endpoints/liveblocks.ts +0 -14
  146. package/src/api/endpoints/users.ts +0 -26
  147. package/src/api/endpoints/workspaces/index.ts +0 -3
  148. package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
  149. package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
  150. package/src/api/endpoints/workspaces/workspaces.ts +0 -47
  151. package/src/api/index.ts +0 -6
  152. package/src/api/payloads/design-systems/index.ts +0 -2
  153. package/src/api/payloads/design-systems/update-design-system.ts +0 -29
  154. package/src/api/payloads/design-systems/version.ts +0 -29
  155. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  156. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  157. package/src/api/payloads/documentation/index.ts +0 -2
  158. package/src/api/payloads/export/index.ts +0 -1
  159. package/src/api/payloads/export/pipeline.ts +0 -74
  160. package/src/api/payloads/index.ts +0 -6
  161. package/src/api/payloads/liveblocks/auth.ts +0 -7
  162. package/src/api/payloads/liveblocks/index.ts +0 -1
  163. package/src/api/payloads/users/index.ts +0 -2
  164. package/src/api/payloads/users/notifications/index.ts +0 -1
  165. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  166. package/src/api/payloads/users/profile/index.ts +0 -1
  167. package/src/api/payloads/users/profile/update.ts +0 -4
  168. package/src/api/payloads/workspaces/index.ts +0 -3
  169. package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
  170. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  171. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  172. package/src/api/transport/index.ts +0 -2
  173. package/src/api/transport/request-executor-error.ts +0 -66
  174. package/src/api/transport/request-executor.ts +0 -87
  175. package/src/events/design-system.ts +0 -21
  176. package/src/events/event.ts +0 -6
  177. package/src/events/index.ts +0 -2
  178. package/src/index.ts +0 -4
  179. package/src/utils/figma.ts +0 -72
  180. package/src/utils/hash.ts +0 -62
  181. package/src/utils/index.ts +0 -3
  182. package/src/utils/query.ts +0 -18
  183. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
  184. package/src/yjs/design-system-content/index.ts +0 -2
  185. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  186. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
  187. package/src/yjs/docs-editor/index.ts +0 -7
  188. package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
  189. package/src/yjs/docs-editor/mock.ts +0 -2142
  190. package/src/yjs/docs-editor/model/block.ts +0 -8
  191. package/src/yjs/docs-editor/model/index.ts +0 -2
  192. package/src/yjs/docs-editor/model/page.ts +0 -8
  193. package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
  194. package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
  195. package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
  196. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  197. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
  198. package/src/yjs/docs-editor/utils.ts +0 -115
  199. package/src/yjs/index.ts +0 -3
  200. package/src/yjs/version-room/backend.ts +0 -83
  201. package/src/yjs/version-room/base.ts +0 -252
  202. package/src/yjs/version-room/frontend.ts +0 -463
  203. package/src/yjs/version-room/index.ts +0 -4
  204. package/src/yjs/version-room/utils.ts +0 -109
package/dist/index.js CHANGED
@@ -130,7 +130,6 @@ var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequire
130
130
 
131
131
 
132
132
 
133
-
134
133
 
135
134
 
136
135
  var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr);
@@ -927,6 +926,23 @@ var ContentLoaderPayload = _zod.z.object({
927
926
  location: _zod.z.string()
928
927
  })
929
928
  );
929
+ var shortPersistentIdLength = 8;
930
+ var alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
931
+ function generateShortPersistentId() {
932
+ return generateAlphanumericId(shortPersistentIdLength);
933
+ }
934
+ function generateAlphanumericId(length) {
935
+ let randomString = "";
936
+ for (let i = 0; i < length; i++) {
937
+ const randomIndex = Math.floor(Math.random() * alphanumeric.length);
938
+ randomString += alphanumeric.charAt(randomIndex);
939
+ }
940
+ return randomString;
941
+ }
942
+ function slugify(str, options) {
943
+ const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
944
+ return _optionalChain([slug, 'optionalAccess', _2 => _2.length]) > 0 ? slug : "item";
945
+ }
930
946
  var RESERVED_SLUGS = [
931
947
  "workspaces",
932
948
  "workspace",
@@ -3689,14 +3705,6 @@ var DocumentationPage = _zod.z.object({
3689
3705
  createdAt: _zod.z.coerce.date(),
3690
3706
  updatedAt: _zod.z.coerce.date()
3691
3707
  });
3692
- var PageRedirect = _zod.z.object({
3693
- id: _zod.z.string(),
3694
- pagePersistentId: _zod.z.string(),
3695
- path: _zod.z.string(),
3696
- createdAt: _zod.z.coerce.date(),
3697
- updatedAt: _zod.z.coerce.date(),
3698
- designSystemId: _zod.z.string()
3699
- });
3700
3708
  var DocumentationSettings = _zod.z.object({
3701
3709
  // Basic
3702
3710
  designSystemVersionId: _zod.z.string(),
@@ -3876,7 +3884,7 @@ var HANDLE_MIN_LENGTH = 2;
3876
3884
  var HANDLE_MAX_LENGTH = 64;
3877
3885
  var CreateWorkspaceInput = _zod.z.object({
3878
3886
  name: _zod.z.string().min(WORKSPACE_NAME_MIN_LENGTH).max(WORKSPACE_NAME_MAX_LENGTH).trim(),
3879
- handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _2 => _2.length]) > 0).optional()
3887
+ handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _3 => _3.length]) > 0).optional()
3880
3888
  });
3881
3889
  var WorkspaceInvitation = _zod.z.object({
3882
3890
  id: _zod.z.string(),
@@ -4380,8 +4388,7 @@ var DesignSystemVersionRoomUpdate = _zod.z.object({
4380
4388
  groupSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
4381
4389
  pageHashesToUpdate: _zod.z.record(_zod.z.string(), _zod.z.string()),
4382
4390
  pageApprovals: _zod.z.array(DocumentationPageApproval),
4383
- pageApprovalIdsToDelete: _zod.z.array(_zod.z.string()),
4384
- executedTransactionIds: _zod.z.array(_zod.z.string())
4391
+ pageApprovalIdsToDelete: _zod.z.array(_zod.z.string())
4385
4392
  });
4386
4393
  var DocumentationPageRoom = Entity.extend({
4387
4394
  designSystemVersionId: _zod.z.string(),
@@ -4528,7 +4535,7 @@ var IntegrationToken = _zod.z.object({
4528
4535
  token_bitbucket_username: _zod.z.string().optional(),
4529
4536
  // Bitbucket only
4530
4537
  custom_url: _zod.z.string().optional().transform((value) => {
4531
- if (!_optionalChain([value, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]))
4538
+ if (!_optionalChain([value, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()]))
4532
4539
  return void 0;
4533
4540
  return formatCustomUrl(value);
4534
4541
  })
@@ -4940,7 +4947,7 @@ function calculateElementParentChain(elementParentPersistentId, groupPersistentI
4940
4947
  const parent = groupPersistentIdToGroupMap.get(parentId);
4941
4948
  if (parent)
4942
4949
  result.push(parent);
4943
- parentId = _optionalChain([parent, 'optionalAccess', _5 => _5.parentPersistentId]);
4950
+ parentId = _optionalChain([parent, 'optionalAccess', _6 => _6.parentPersistentId]);
4944
4951
  }
4945
4952
  return result;
4946
4953
  }
@@ -4949,7 +4956,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4949
4956
  ...group,
4950
4957
  data: {
4951
4958
  ...group.data,
4952
- configuration: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.configuration]), () => ( getDefaultItemConfiguration()))
4959
+ configuration: _nullishCoalesce(_optionalChain([group, 'access', _7 => _7.data, 'optionalAccess', _8 => _8.configuration]), () => ( getDefaultItemConfiguration()))
4953
4960
  }
4954
4961
  }));
4955
4962
  const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, (group) => group.persistentId);
@@ -4961,8 +4968,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4961
4968
  const parent = groupPersistentIdToGroupMap.get(nextParentId);
4962
4969
  if (!parent)
4963
4970
  break;
4964
- isHidden = isHidden || _optionalChain([parent, 'access', _8 => _8.data, 'optionalAccess', _9 => _9.configuration, 'optionalAccess', _10 => _10.isHidden]) || false;
4965
- isPrivate = isPrivate || _optionalChain([parent, 'access', _11 => _11.data, 'optionalAccess', _12 => _12.configuration, 'optionalAccess', _13 => _13.isPrivate]) || false;
4971
+ isHidden = isHidden || _optionalChain([parent, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.configuration, 'optionalAccess', _11 => _11.isHidden]) || false;
4972
+ isPrivate = isPrivate || _optionalChain([parent, 'access', _12 => _12.data, 'optionalAccess', _13 => _13.configuration, 'optionalAccess', _14 => _14.isPrivate]) || false;
4966
4973
  nextParentId = parent.parentPersistentId;
4967
4974
  }
4968
4975
  groupToFix.data.configuration.isHidden = isHidden;
@@ -4970,7 +4977,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4970
4977
  }
4971
4978
  const fixedPages = [];
4972
4979
  for (const page of pages) {
4973
- const configuration = _nullishCoalesce(_optionalChain([page, 'access', _14 => _14.data, 'optionalAccess', _15 => _15.configuration]), () => ( getDefaultItemConfiguration()));
4980
+ const configuration = _nullishCoalesce(_optionalChain([page, 'access', _15 => _15.data, 'optionalAccess', _16 => _16.configuration]), () => ( getDefaultItemConfiguration()));
4974
4981
  const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);
4975
4982
  fixedPages.push({
4976
4983
  ...page,
@@ -4978,8 +4985,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4978
4985
  ...page.data,
4979
4986
  configuration: {
4980
4987
  ...configuration,
4981
- isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.configuration, 'optionalAccess', _18 => _18.isHidden]) || false,
4982
- isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess', _19 => _19.data, 'optionalAccess', _20 => _20.configuration, 'optionalAccess', _21 => _21.isPrivate]) || false
4988
+ isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _17 => _17.data, 'optionalAccess', _18 => _18.configuration, 'optionalAccess', _19 => _19.isHidden]) || false,
4989
+ isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess', _20 => _20.data, 'optionalAccess', _21 => _21.configuration, 'optionalAccess', _22 => _22.isPrivate]) || false
4983
4990
  }
4984
4991
  }
4985
4992
  });
@@ -4997,7 +5004,7 @@ function elementGroupsToDocumentationGroupDTOV1(groups, pages) {
4997
5004
  return groups.map((group) => {
4998
5005
  return {
4999
5006
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
5000
- configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.configuration]))
5007
+ configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _23 => _23.data, 'optionalAccess', _24 => _24.configuration]))
5001
5008
  };
5002
5009
  });
5003
5010
  }
@@ -5005,7 +5012,7 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(groups, pages)
5005
5012
  const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);
5006
5013
  const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems(pages, groups, getDtoDefaultItemConfigurationV1);
5007
5014
  return fixedGroups.map((group) => {
5008
- const configuration = documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.configuration]));
5015
+ const configuration = documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _25 => _25.data, 'optionalAccess', _26 => _26.configuration]));
5009
5016
  return {
5010
5017
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
5011
5018
  // backward compatibility with custom doc exporters, anyway these groups will not be shown, so we can adjust title
@@ -5030,7 +5037,7 @@ function elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap) {
5030
5037
  title: group.meta.name,
5031
5038
  childrenIds,
5032
5039
  isRoot: !group.parentPersistentId,
5033
- groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.behavior]), () => ( "Group")),
5040
+ groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _27 => _27.data, 'optionalAccess', _28 => _28.behavior]), () => ( "Group")),
5034
5041
  shortPersistentId: group.shortPersistentId,
5035
5042
  type: "Group"
5036
5043
  };
@@ -5088,10 +5095,10 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV2(groups, pages)
5088
5095
  function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
5089
5096
  const childrenIds = _nullishCoalesce(childrenIdsMap.get(group.persistentId), () => ( []));
5090
5097
  if (!group.shortPersistentId) {
5091
- throw new Error(`Short persistent id is required for docs groups, group id: ${group.id}`);
5098
+ throw new Error(`Short persistent id is required for docs groups, group id: ${group.persistentId}`);
5092
5099
  }
5093
5100
  return {
5094
- id: group.id,
5101
+ id: "to_be_removed",
5095
5102
  designSystemVersionId: group.designSystemVersionId,
5096
5103
  persistentId: group.persistentId,
5097
5104
  slug: group.slug,
@@ -5099,10 +5106,10 @@ function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
5099
5106
  createdAt: group.createdAt,
5100
5107
  updatedAt: group.updatedAt,
5101
5108
  title: group.meta.name,
5102
- configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _28 => _28.data, 'optionalAccess', _29 => _29.configuration])),
5109
+ configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _29 => _29.data, 'optionalAccess', _30 => _30.configuration])),
5103
5110
  childrenIds,
5104
5111
  isRoot: !group.parentPersistentId,
5105
- groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.behavior]), () => ( "Group")),
5112
+ groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _31 => _31.data, 'optionalAccess', _32 => _32.behavior]), () => ( "Group")),
5106
5113
  shortPersistentId: group.shortPersistentId,
5107
5114
  type: "Group"
5108
5115
  };
@@ -5173,12 +5180,12 @@ function documentationPagesFixedConfigurationToDTOV2(pages, groups, routingVersi
5173
5180
  function _documentationPageToDTOV2(page, pagePathMap, pageLiveblocksRoomIdMap) {
5174
5181
  let path = pagePathMap.get(page.persistentId);
5175
5182
  if (!path)
5176
- throw new Error(`Path for page ${page.id} was not calculated`);
5183
+ throw new Error(`Path for page ${page.persistentId} was not calculated`);
5177
5184
  if (path.startsWith("/"))
5178
5185
  path = path.substring(1);
5179
5186
  const liveblocksRoomId = pageLiveblocksRoomIdMap.get(page.persistentId);
5180
5187
  return {
5181
- id: page.id,
5188
+ id: "to_be_removed",
5182
5189
  designSystemVersionId: page.designSystemVersionId,
5183
5190
  persistentId: page.persistentId,
5184
5191
  shortPersistentId: page.shortPersistentId,
@@ -5259,7 +5266,7 @@ function integrationToDto(integration) {
5259
5266
  workspaceId: integration.workspaceId,
5260
5267
  type: integration.type,
5261
5268
  createdAt: integration.createdAt,
5262
- integrationCredentials: _optionalChain([integration, 'access', _32 => _32.integrationCredentials, 'optionalAccess', _33 => _33.map, 'call', _34 => _34(integrationCredentialToDto)]),
5269
+ integrationCredentials: _optionalChain([integration, 'access', _33 => _33.integrationCredentials, 'optionalAccess', _34 => _34.map, 'call', _35 => _35(integrationCredentialToDto)]),
5263
5270
  integrationDesignSystems: _nullishCoalesce(integration.integrationDesignSystems, () => ( void 0))
5264
5271
  };
5265
5272
  }
@@ -5378,7 +5385,6 @@ var DTOUserProfileUpdate = UserProfileUpdate;
5378
5385
  var DTOUserOnboardingDepartment = UserOnboardingDepartment;
5379
5386
  var DTOUserOnboardingJobLevel = UserOnboardingJobLevel;
5380
5387
  var DTOUserSource = UserSource;
5381
- var DTOUserTheme = UserTheme;
5382
5388
  var DTOUserOnboarding = _zod.z.object({
5383
5389
  companyName: _zod.z.string().optional(),
5384
5390
  numberOfPeopleInOrg: _zod.z.string().optional(),
@@ -5392,8 +5398,7 @@ var DTOUserOnboarding = _zod.z.object({
5392
5398
  isPageDraftOnboardingFinished: _zod.z.boolean().optional()
5393
5399
  });
5394
5400
  var DTOAuthenticatedUserProfile = DTOUserProfile.extend({
5395
- onboarding: DTOUserOnboarding.optional(),
5396
- theme: DTOUserTheme.optional()
5401
+ onboarding: DTOUserOnboarding.optional()
5397
5402
  });
5398
5403
  var DTOAuthenticatedUser = DTOUser.extend({
5399
5404
  profile: DTOAuthenticatedUserProfile,
@@ -5732,28 +5737,6 @@ var DTOBffImportRequestBody = _zod.z.discriminatedUnion("type", [
5732
5737
  DTOBffUploadImportRequestBody
5733
5738
  ]);
5734
5739
 
5735
- // src/api/dto/design-systems/redirects.ts
5736
-
5737
- var DTOPageRedirectCreateBody = _zod.z.object({
5738
- pagePersistentId: _zod.z.string(),
5739
- path: _zod.z.string()
5740
- });
5741
- var DTOPageRedirectUpdateBody = DTOPageRedirectCreateBody.partial();
5742
- var DTOPageRedirect = _zod.z.object({
5743
- id: _zod.z.string(),
5744
- pagePersistentId: _zod.z.string(),
5745
- path: _zod.z.string()
5746
- });
5747
- var DTOPageRedirectListResponse = _zod.z.object({
5748
- redirects: DTOPageRedirect.array()
5749
- });
5750
- var DTOPageRedirectResponse = _zod.z.object({
5751
- redirect: DTOPageRedirect
5752
- });
5753
- var DTOPageRedirectDeleteResponse = _zod.z.object({
5754
- success: _zod.z.boolean()
5755
- });
5756
-
5757
5740
  // src/api/dto/design-systems/stats.ts
5758
5741
 
5759
5742
  var DTODesignSystemVersionStats = _zod.z.object({
@@ -5770,15 +5753,6 @@ var DTODesignSystemVersionStatsQuery = _zod.z.object({
5770
5753
  brandId: _zod.z.string().optional()
5771
5754
  });
5772
5755
 
5773
- // src/api/dto/design-systems/version-room.ts
5774
-
5775
- var DTODesignSystemVersionRoom = _zod.z.object({
5776
- id: _zod.z.string()
5777
- });
5778
- var DTODesignSystemVersionRoomResponse = _zod.z.object({
5779
- room: DTODesignSystemVersionRoom
5780
- });
5781
-
5782
5756
  // src/api/dto/design-systems/version.ts
5783
5757
 
5784
5758
 
@@ -6364,7 +6338,7 @@ var DTOGetDocumentationPageAnchorsResponse = _zod.z.object({
6364
6338
  var DTODocumentationPageApprovalState = DocumentationPageApproval;
6365
6339
  var DTODocumentationGroupApprovalState = _zod.z.object({
6366
6340
  persistentId: _zod.z.string(),
6367
- groupId: _zod.z.string(),
6341
+ groupPersistentId: _zod.z.string(),
6368
6342
  designSystemVersionId: _zod.z.string(),
6369
6343
  approvalState: DocumentationPageApprovalState
6370
6344
  });
@@ -7292,11 +7266,7 @@ var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
7292
7266
  DTODocumentationGroupRestoreActionInput,
7293
7267
  // Approval
7294
7268
  DTODocumentationPageApprovalStateChangeActionInput
7295
- ]).and(
7296
- _zod.z.object({
7297
- tId: _zod.z.string().optional()
7298
- })
7299
- );
7269
+ ]);
7300
7270
 
7301
7271
  // src/api/dto/elements/get-elements-v2.ts
7302
7272
 
@@ -7672,7 +7642,6 @@ var DesignSystemComponentEndpoint = class {
7672
7642
  };
7673
7643
 
7674
7644
  // src/api/endpoints/design-system/versions/elements-action.ts
7675
- var _crypto = require('crypto');
7676
7645
  var ElementsActionEndpoint = class {
7677
7646
  constructor(requestExecutor) {
7678
7647
  this.requestExecutor = requestExecutor;
@@ -7702,8 +7671,6 @@ var ElementsActionEndpoint = class {
7702
7671
  return this.action(dsId, vId, { type: "FigmaNodeRenderAsync", nodes });
7703
7672
  }
7704
7673
  async action(dsId, vId, input) {
7705
- if (!input.tId)
7706
- input.tId = _crypto.randomUUID.call(void 0, );
7707
7674
  return this.requestExecutor.json(
7708
7675
  `/design-systems/${dsId}/versions/${vId}/elements-action`,
7709
7676
  DTOElementActionOutput,
@@ -8016,12 +7983,6 @@ var DesignSystemVersionsEndpoint = class {
8016
7983
  DTODesignSystemVersionJobStatusResponse
8017
7984
  );
8018
7985
  }
8019
- room(dsId, vId) {
8020
- return this.requestExecutor.json(
8021
- `/design-systems/${dsId}/versions/${vId}/room`,
8022
- DTODesignSystemVersionRoomResponse
8023
- );
8024
- }
8025
7986
  };
8026
7987
 
8027
7988
  // src/api/endpoints/design-system/bff.ts
@@ -8369,7 +8330,7 @@ var RequestExecutor = class {
8369
8330
  }
8370
8331
  fullUrl(path, query) {
8371
8332
  let url = `https://${this.testServerConfig.host}/api/v2${path}`;
8372
- const queryString = _optionalChain([query, 'optionalAccess', _35 => _35.toString, 'call', _36 => _36()]);
8333
+ const queryString = _optionalChain([query, 'optionalAccess', _36 => _36.toString, 'call', _37 => _37()]);
8373
8334
  if (queryString)
8374
8335
  url += `?${queryString}`;
8375
8336
  return url;
@@ -8396,26 +8357,8 @@ var SupernovaApiClient = class {
8396
8357
  }
8397
8358
  };
8398
8359
 
8399
- // src/events/design-system.ts
8400
-
8401
- var DTOEventFigmaNodesRendered = _zod.z.object({
8402
- type: _zod.z.literal("DesignSystem.FigmaNodesRendered"),
8403
- designSystemId: _zod.z.string(),
8404
- versionId: _zod.z.string(),
8405
- figmaNodePersistentIds: _zod.z.string().array()
8406
- });
8407
- var DTOEventDataSourcesImported = _zod.z.object({
8408
- type: _zod.z.literal("DesignSystem.ImportJobFinished"),
8409
- designSystemId: _zod.z.string(),
8410
- versionId: _zod.z.string(),
8411
- importJobId: _zod.z.string(),
8412
- dataSourceType: DataSourceRemoteType,
8413
- dataSourceIds: _zod.z.string().array()
8414
- });
8415
-
8416
- // src/events/event.ts
8417
-
8418
- var DTOEvent = _zod.z.discriminatedUnion("type", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);
8360
+ // src/sync/docs-structure-repo.ts
8361
+ var _pqueue = require('p-queue'); var _pqueue2 = _interopRequireDefault(_pqueue);
8419
8362
 
8420
8363
  // src/yjs/design-system-content/documentation-hierarchy.ts
8421
8364
 
@@ -8426,6 +8369,21 @@ var VersionRoomBaseYDoc = class {
8426
8369
  __publicField(this, "yDoc");
8427
8370
  this.yDoc = yDoc;
8428
8371
  }
8372
+ getState() {
8373
+ const groups = this.getGroups();
8374
+ const isLoaded = !!groups.length;
8375
+ return {
8376
+ isLoaded,
8377
+ groups,
8378
+ pages: this.getPages(),
8379
+ approvals: this.getApprovals(),
8380
+ groupSnapshots: this.getGroupSnapshots(),
8381
+ pageContentHashes: this.getDocumentationPageContentHashes(),
8382
+ pageSnapshots: this.getPageSnapshots(),
8383
+ settings: this.getDocumentationInternalSettings(),
8384
+ pageLiveblockRoomIds: this.getDocumentationPageLiveblocksRoomIds()
8385
+ };
8386
+ }
8429
8387
  //
8430
8388
  // Pages
8431
8389
  //
@@ -8574,9 +8532,7 @@ var VersionRoomBaseYDoc = class {
8574
8532
  get documentationPageContentHashesYMap() {
8575
8533
  return this.yDoc.getMap("documentationPageHashes");
8576
8534
  }
8577
- //
8578
8535
  // Approval states
8579
- //
8580
8536
  updateApprovalStates(updates) {
8581
8537
  this.setObjects(this.documentationPageApprovalsMap, updates);
8582
8538
  }
@@ -8589,23 +8545,237 @@ var VersionRoomBaseYDoc = class {
8589
8545
  get documentationPageApprovalsMap() {
8590
8546
  return this.yDoc.getMap("documentationPageApprovals");
8591
8547
  }
8592
- //
8593
- // Executed transactions
8594
- //
8595
- updateExecutedTransactionIds(transactionIds) {
8596
- transactionIds = Array.from(new Set(transactionIds));
8597
- if (!transactionIds.length)
8548
+ };
8549
+
8550
+ // src/yjs/version-room/compute-dto.ts
8551
+ function computeDocsHierarchy(input, options = {}) {
8552
+ const includeDeletedContent = _nullishCoalesce(options.includeDeletedContent, () => ( false));
8553
+ const debug = _nullishCoalesce(options.debug, () => ( false));
8554
+ const { pages, groups, pageSnapshots, groupSnapshots, settings, pageContentHashes, approvals, pageLiveblockRoomIds } = input;
8555
+ if (includeDeletedContent) {
8556
+ pages.push(...getDeletedPages(pages, pageSnapshots));
8557
+ groups.push(...getDeletedGroups(groups, groupSnapshots));
8558
+ }
8559
+ const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion, recordToMap(pageLiveblockRoomIds));
8560
+ const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
8561
+ if (!settings.isDraftFeatureAdopted) {
8562
+ return {
8563
+ pages: pageDTOs,
8564
+ groups: groupDTOs
8565
+ };
8566
+ }
8567
+ const pageDraftStates = buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageContentHashes, debug);
8568
+ const pageDraftDeletedStates = buildPageDraftDeletedStates(pages, pageSnapshots);
8569
+ const pagePublishedMetadata = buildPagePublishedMetadata(pages, pageSnapshots);
8570
+ const pageApprovalStates = mapByUnique(approvals, (a) => a.pagePersistentId);
8571
+ pageDTOs.forEach((p) => {
8572
+ const draftState = _nullishCoalesce(pageDraftDeletedStates.get(p.persistentId), () => ( pageDraftStates.get(p.persistentId)));
8573
+ draftState && (p.draftState = draftState);
8574
+ const publishMetadata = pagePublishedMetadata.get(p.persistentId);
8575
+ publishMetadata && (p.publishMetadata = publishMetadata);
8576
+ const approvalState = pageApprovalStates.get(p.persistentId);
8577
+ approvalState && (p.approvalState = approvalState);
8578
+ });
8579
+ const groupDraftStates = buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug);
8580
+ const groupDraftDeletedStates = buildGroupDraftDeletedStates(groups, groupSnapshots);
8581
+ const groupPublishedMetadata = buildGroupPublishedMetadata(groups, groupSnapshots);
8582
+ const groupApprovalStates = buildGroupApprovalStates(groups, groupSnapshots);
8583
+ groupDTOs.forEach((g) => {
8584
+ const draftState = _nullishCoalesce(groupDraftDeletedStates.get(g.persistentId), () => ( groupDraftStates.get(g.persistentId)));
8585
+ draftState && (g.draftState = draftState);
8586
+ const publishMetadata = groupPublishedMetadata.get(g.persistentId);
8587
+ publishMetadata && (g.publishMetadata = publishMetadata);
8588
+ const approvalState = groupApprovalStates.get(g.persistentId);
8589
+ approvalState && (g.approvalState = approvalState);
8590
+ });
8591
+ return {
8592
+ pages: pageDTOs,
8593
+ groups: groupDTOs
8594
+ };
8595
+ }
8596
+ function getDeletedPages(pages, pageSnapshots) {
8597
+ const existingPagePersistentIds = new Set(pages.map((p) => p.persistentId));
8598
+ const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);
8599
+ return latestSnapshots.filter((s) => !existingPagePersistentIds.has(s.page.persistentId)).map((s) => s.page);
8600
+ }
8601
+ function getDeletedGroups(groups, groupSnapshots) {
8602
+ const existingGroupPersistentIds = new Set(groups.map((p) => p.persistentId));
8603
+ const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);
8604
+ return latestSnapshots.filter((s) => !existingGroupPersistentIds.has(s.group.persistentId)).map((s) => s.group);
8605
+ }
8606
+ function buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageHashes, debug) {
8607
+ const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish"));
8608
+ const publishedSnapshotsByPagePersistentId = mapByUnique(publishedSnapshots, (s) => s.page.persistentId);
8609
+ const result = /* @__PURE__ */ new Map();
8610
+ pages.forEach((page) => {
8611
+ const snapshot = publishedSnapshotsByPagePersistentId.get(page.persistentId);
8612
+ let publishedState;
8613
+ if (snapshot) {
8614
+ publishedState = itemStateFromPage(snapshot.page, snapshot.pageContentHash);
8615
+ }
8616
+ const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _38 => _38.pageContentHash]))), () => ( ""));
8617
+ const currentState = itemStateFromPage(page, currentPageContentHash);
8618
+ const draftState = createDraftState(page.persistentId, currentState, publishedState, debug);
8619
+ if (draftState)
8620
+ result.set(page.persistentId, draftState);
8621
+ });
8622
+ return result;
8623
+ }
8624
+ function itemStateFromPage(page, pageContentHash) {
8625
+ return {
8626
+ title: page.meta.name,
8627
+ configuration: _nullishCoalesce(page.data.configuration, () => ( defaultDocumentationItemConfigurationV2)),
8628
+ contentHash: pageContentHash
8629
+ };
8630
+ }
8631
+ function buildPagePublishedMetadata(pages, pageSnapshots) {
8632
+ const publishedPageSnapshotsByPersistentId = mapByUnique(
8633
+ pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
8634
+ (s) => s.page.persistentId
8635
+ );
8636
+ const result = /* @__PURE__ */ new Map();
8637
+ pages.forEach((p) => {
8638
+ const publishedSnapshot = publishedPageSnapshotsByPersistentId.get(p.persistentId);
8639
+ if (!publishedSnapshot)
8598
8640
  return;
8599
- const array = this.executedTransactionIdsArray;
8600
- array.push(transactionIds);
8601
- if (array.length > 100) {
8602
- array.delete(0, array.length - 100);
8641
+ result.set(p.persistentId, {
8642
+ lastPublishedAt: publishedSnapshot.createdAt,
8643
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
8644
+ });
8645
+ });
8646
+ return result;
8647
+ }
8648
+ function createDraftState(itemPersistentId, currentState, publishedState, debug) {
8649
+ if (!publishedState) {
8650
+ return { changeType: "Created" };
8651
+ }
8652
+ const updatedDraftState = {
8653
+ changeType: "Updated",
8654
+ changes: {}
8655
+ };
8656
+ if (currentState.title !== publishedState.title) {
8657
+ if (debug) {
8658
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);
8603
8659
  }
8660
+ updatedDraftState.changes.previousTitle = publishedState.title;
8604
8661
  }
8605
- get executedTransactionIdsArray() {
8606
- return this.yDoc.getArray("executedTransactionIds");
8662
+ const currentConfigHash = generateHash(currentState.configuration, debug);
8663
+ const publishedConfigHash = generateHash(publishedState.configuration, debug);
8664
+ if (currentConfigHash !== publishedConfigHash) {
8665
+ if (debug) {
8666
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
8667
+ }
8668
+ const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);
8669
+ updatedDraftState.changes.previousConfiguration = configurationDto;
8607
8670
  }
8608
- };
8671
+ if (currentState.contentHash !== publishedState.contentHash) {
8672
+ if (debug) {
8673
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);
8674
+ }
8675
+ updatedDraftState.changes.previousContentHash = publishedState.contentHash;
8676
+ }
8677
+ if (Object.keys(updatedDraftState.changes).length) {
8678
+ return updatedDraftState;
8679
+ }
8680
+ return void 0;
8681
+ }
8682
+ function buildGroupApprovalStates(groups, groupSnapshots) {
8683
+ const result = /* @__PURE__ */ new Map();
8684
+ const allGroups = [...groups, ...groupSnapshots];
8685
+ for (const g of allGroups) {
8686
+ const approvalState = {
8687
+ approvalState: "Approved",
8688
+ designSystemVersionId: g.designSystemVersionId,
8689
+ persistentId: g.persistentId,
8690
+ groupPersistentId: g.persistentId
8691
+ };
8692
+ result.set(g.persistentId, approvalState);
8693
+ }
8694
+ return result;
8695
+ }
8696
+ function buildPageDraftDeletedStates(pages, pageSnapshots) {
8697
+ const deletedSnapshotsByPagePersistentId = mapByUnique(
8698
+ pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Deletion")),
8699
+ (s) => s.page.persistentId
8700
+ );
8701
+ const result = /* @__PURE__ */ new Map();
8702
+ pages.forEach((page) => {
8703
+ const deletedSnapshot = deletedSnapshotsByPagePersistentId.get(page.persistentId);
8704
+ if (!deletedSnapshot)
8705
+ return;
8706
+ result.set(page.persistentId, {
8707
+ changeType: "Deleted",
8708
+ deletedAt: deletedSnapshot.createdAt,
8709
+ deletedByUserId: deletedSnapshot.createdByUserId
8710
+ });
8711
+ });
8712
+ return result;
8713
+ }
8714
+ function buildGroupDraftDeletedStates(groups, groupSnapshots) {
8715
+ const deletedSnapshotsByGroupPersistentId = mapByUnique(
8716
+ pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Deletion")),
8717
+ (s) => s.group.persistentId
8718
+ );
8719
+ const result = /* @__PURE__ */ new Map();
8720
+ groups.forEach((group) => {
8721
+ if (!group.parentPersistentId)
8722
+ return;
8723
+ const deletedSnapshot = deletedSnapshotsByGroupPersistentId.get(group.persistentId);
8724
+ if (!deletedSnapshot)
8725
+ return;
8726
+ result.set(group.persistentId, {
8727
+ changeType: "Deleted",
8728
+ deletedAt: deletedSnapshot.createdAt,
8729
+ deletedByUserId: deletedSnapshot.createdByUserId
8730
+ });
8731
+ });
8732
+ return result;
8733
+ }
8734
+ function buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug) {
8735
+ const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish"));
8736
+ const publishedSnapshotsByGroupPersistent = mapByUnique(publishedSnapshots, (s) => s.group.persistentId);
8737
+ const result = /* @__PURE__ */ new Map();
8738
+ groups.forEach((group) => {
8739
+ if (!group.parentPersistentId)
8740
+ return;
8741
+ const currentState = itemStateFromGroup(group);
8742
+ const snapshot = publishedSnapshotsByGroupPersistent.get(group.persistentId);
8743
+ let publishedState;
8744
+ if (snapshot) {
8745
+ publishedState = itemStateFromGroup(snapshot.group);
8746
+ }
8747
+ const draftState = createDraftState(group.persistentId, currentState, publishedState, debug);
8748
+ if (draftState)
8749
+ result.set(group.persistentId, draftState);
8750
+ });
8751
+ return result;
8752
+ }
8753
+ function itemStateFromGroup(group) {
8754
+ return {
8755
+ title: group.meta.name,
8756
+ configuration: _nullishCoalesce(_optionalChain([group, 'access', _39 => _39.data, 'optionalAccess', _40 => _40.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
8757
+ contentHash: "-"
8758
+ };
8759
+ }
8760
+ function buildGroupPublishedMetadata(groups, groupSnapshots) {
8761
+ const publishedGroupSnapshotsByPersistentId = mapByUnique(
8762
+ pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
8763
+ (s) => s.group.persistentId
8764
+ );
8765
+ const result = /* @__PURE__ */ new Map();
8766
+ groups.forEach((g) => {
8767
+ if (!g.parentPersistentId)
8768
+ return;
8769
+ const publishedSnapshot = publishedGroupSnapshotsByPersistentId.get(g.persistentId);
8770
+ if (!publishedSnapshot)
8771
+ return;
8772
+ result.set(g.persistentId, {
8773
+ lastPublishedAt: publishedSnapshot.createdAt,
8774
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
8775
+ });
8776
+ });
8777
+ return result;
8778
+ }
8609
8779
 
8610
8780
  // src/yjs/version-room/utils.ts
8611
8781
  function generatePageContentHash(content, definitions, debug = false) {
@@ -8686,248 +8856,8 @@ var FrontendVersionRoomYDoc = class {
8686
8856
  // Hierarchy
8687
8857
  //
8688
8858
  getDocumentationHierarchy(options = {}) {
8689
- const includeDeletedContent = _nullishCoalesce(options.includeDeletedContent, () => ( false));
8690
- const doc = new VersionRoomBaseYDoc(this.yDoc);
8691
- const pages = doc.getPages();
8692
- const groups = doc.getGroups();
8693
- const pageSnapshots = doc.getPageSnapshots();
8694
- const groupSnapshots = doc.getGroupSnapshots();
8695
- const liveblocksRoomIds = recordToMap(doc.getDocumentationPageLiveblocksRoomIds());
8696
- if (includeDeletedContent) {
8697
- pages.push(...this.getDeletedPages(pages, pageSnapshots));
8698
- groups.push(...this.getDeletedGroups(groups, groupSnapshots));
8699
- }
8700
- const settings = doc.getDocumentationInternalSettings();
8701
- const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion, liveblocksRoomIds);
8702
- const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
8703
- if (!settings.isDraftFeatureAdopted) {
8704
- return {
8705
- pages: pageDTOs,
8706
- groups: groupDTOs
8707
- };
8708
- }
8709
- const pageDraftStates = this.buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots);
8710
- const pageDraftDeletedStates = this.buildPageDraftDeletedStates(pages, pageSnapshots);
8711
- const pagePublishedMetadata = this.buildPagePublishedMetadata(pages, pageSnapshots);
8712
- const pageApprovalStates = this.buildPageApprovalStates(pages);
8713
- pageDTOs.forEach((p) => {
8714
- const draftState = _nullishCoalesce(pageDraftDeletedStates.get(p.id), () => ( pageDraftStates.get(p.id)));
8715
- draftState && (p.draftState = draftState);
8716
- const publishMetadata = pagePublishedMetadata.get(p.id);
8717
- publishMetadata && (p.publishMetadata = publishMetadata);
8718
- const approvalState = pageApprovalStates.get(p.id);
8719
- approvalState && (p.approvalState = approvalState);
8720
- });
8721
- const groupDraftStates = this.buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots);
8722
- const groupDraftDeletedStates = this.buildGroupDraftDeletedStates(groups, groupSnapshots);
8723
- const groupPublishedMetadata = this.buildGroupPublishedMetadata(groups, groupSnapshots);
8724
- const groupApprovalStates = this.buildGroupApprovalStates(groups, groupSnapshots);
8725
- groupDTOs.forEach((g) => {
8726
- const draftState = _nullishCoalesce(groupDraftDeletedStates.get(g.id), () => ( groupDraftStates.get(g.id)));
8727
- draftState && (g.draftState = draftState);
8728
- const publishMetadata = groupPublishedMetadata.get(g.id);
8729
- publishMetadata && (g.publishMetadata = publishMetadata);
8730
- const approvalState = groupApprovalStates.get(g.id);
8731
- approvalState && (g.approvalState = approvalState);
8732
- });
8733
- return {
8734
- pages: pageDTOs,
8735
- groups: groupDTOs
8736
- };
8737
- }
8738
- //
8739
- // Drafts - Pages
8740
- //
8741
- buildPageDraftDeletedStates(pages, pageSnapshots) {
8742
- const deletedSnapshotsByPageId = mapByUnique(
8743
- pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Deletion")),
8744
- (s) => s.page.id
8745
- );
8746
- const result = /* @__PURE__ */ new Map();
8747
- pages.forEach((page) => {
8748
- const deletedSnapshot = deletedSnapshotsByPageId.get(page.id);
8749
- if (!deletedSnapshot)
8750
- return;
8751
- result.set(page.id, {
8752
- changeType: "Deleted",
8753
- deletedAt: deletedSnapshot.createdAt,
8754
- deletedByUserId: deletedSnapshot.createdByUserId
8755
- });
8756
- });
8757
- return result;
8758
- }
8759
- buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots) {
8760
8859
  const doc = new VersionRoomBaseYDoc(this.yDoc);
8761
- const pageHashes = doc.getDocumentationPageContentHashes();
8762
- const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish"));
8763
- const publishedSnapshotsByPageId = mapByUnique(publishedSnapshots, (s) => s.page.id);
8764
- const result = /* @__PURE__ */ new Map();
8765
- pages.forEach((page) => {
8766
- const snapshot = publishedSnapshotsByPageId.get(page.id);
8767
- let publishedState;
8768
- if (snapshot) {
8769
- publishedState = this.itemStateFromPage(snapshot.page, snapshot.pageContentHash);
8770
- }
8771
- const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _37 => _37.pageContentHash]))), () => ( ""));
8772
- const currentState = this.itemStateFromPage(page, currentPageContentHash);
8773
- const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
8774
- if (draftState)
8775
- result.set(page.id, draftState);
8776
- });
8777
- return result;
8778
- }
8779
- itemStateFromPage(page, pageContentHash) {
8780
- return {
8781
- title: page.meta.name,
8782
- configuration: _nullishCoalesce(page.data.configuration, () => ( defaultDocumentationItemConfigurationV2)),
8783
- contentHash: pageContentHash
8784
- };
8785
- }
8786
- getDeletedPages(pages, pageSnapshots) {
8787
- const existingPageIds = new Set(pages.map((p) => p.id));
8788
- const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);
8789
- return latestSnapshots.filter((s) => !existingPageIds.has(s.page.id)).map((s) => s.page);
8790
- }
8791
- buildPagePublishedMetadata(pages, pageSnapshots) {
8792
- const publishedPageSnapshotsById = mapByUnique(
8793
- pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
8794
- (s) => s.page.id
8795
- );
8796
- const result = /* @__PURE__ */ new Map();
8797
- pages.forEach((p) => {
8798
- const publishedSnapshot = publishedPageSnapshotsById.get(p.id);
8799
- if (!publishedSnapshot)
8800
- return;
8801
- result.set(p.id, {
8802
- lastPublishedAt: publishedSnapshot.createdAt,
8803
- lastPublishedByUserId: publishedSnapshot.createdByUserId
8804
- });
8805
- });
8806
- return result;
8807
- }
8808
- //
8809
- // Drafts - Groups
8810
- //
8811
- buildGroupDraftDeletedStates(groups, groupSnapshots) {
8812
- const deletedSnapshotsByGroupId = mapByUnique(
8813
- pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Deletion")),
8814
- (s) => s.group.id
8815
- );
8816
- const result = /* @__PURE__ */ new Map();
8817
- groups.forEach((group) => {
8818
- if (!group.parentPersistentId)
8819
- return;
8820
- const deletedSnapshot = deletedSnapshotsByGroupId.get(group.id);
8821
- if (!deletedSnapshot)
8822
- return;
8823
- result.set(group.id, {
8824
- changeType: "Deleted",
8825
- deletedAt: deletedSnapshot.createdAt,
8826
- deletedByUserId: deletedSnapshot.createdByUserId
8827
- });
8828
- });
8829
- return result;
8830
- }
8831
- buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots) {
8832
- const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish"));
8833
- const publishedSnapshotsByGroupId = mapByUnique(publishedSnapshots, (s) => s.group.id);
8834
- const result = /* @__PURE__ */ new Map();
8835
- groups.forEach((group) => {
8836
- if (!group.parentPersistentId)
8837
- return;
8838
- const currentState = this.itemStateFromGroup(group);
8839
- const snapshot = publishedSnapshotsByGroupId.get(group.id);
8840
- let publishedState;
8841
- if (snapshot) {
8842
- publishedState = this.itemStateFromGroup(snapshot.group);
8843
- }
8844
- const draftState = this.createDraftState(group.persistentId, currentState, publishedState);
8845
- if (draftState)
8846
- result.set(group.id, draftState);
8847
- });
8848
- return result;
8849
- }
8850
- itemStateFromGroup(group) {
8851
- return {
8852
- title: group.meta.name,
8853
- configuration: _nullishCoalesce(_optionalChain([group, 'access', _38 => _38.data, 'optionalAccess', _39 => _39.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
8854
- contentHash: "-"
8855
- };
8856
- }
8857
- getDeletedGroups(groups, groupSnapshots) {
8858
- const existingGroupIds = new Set(groups.map((p) => p.id));
8859
- const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);
8860
- return latestSnapshots.filter((s) => !existingGroupIds.has(s.group.id)).map((s) => s.group);
8861
- }
8862
- buildGroupPublishedMetadata(groups, groupSnapshots) {
8863
- const publishedGroupSnapshotsById = mapByUnique(
8864
- pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
8865
- (s) => s.group.id
8866
- );
8867
- const result = /* @__PURE__ */ new Map();
8868
- groups.forEach((g) => {
8869
- if (!g.parentPersistentId)
8870
- return;
8871
- const publishedSnapshot = publishedGroupSnapshotsById.get(g.id);
8872
- if (!publishedSnapshot)
8873
- return;
8874
- result.set(g.id, {
8875
- lastPublishedAt: publishedSnapshot.createdAt,
8876
- lastPublishedByUserId: publishedSnapshot.createdByUserId
8877
- });
8878
- });
8879
- return result;
8880
- }
8881
- //
8882
- // Drafts - Shared
8883
- //
8884
- createDraftState(itemPersistentId, currentState, publishedState) {
8885
- if (!publishedState) {
8886
- return { changeType: "Created" };
8887
- }
8888
- const updatedDraftState = {
8889
- changeType: "Updated",
8890
- changes: {}
8891
- };
8892
- if (currentState.title !== publishedState.title) {
8893
- if (this.debug) {
8894
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);
8895
- }
8896
- updatedDraftState.changes.previousTitle = publishedState.title;
8897
- }
8898
- const currentConfigHash = generateHash(currentState.configuration, this.debug);
8899
- const publishedConfigHash = generateHash(publishedState.configuration, this.debug);
8900
- if (currentConfigHash !== publishedConfigHash) {
8901
- if (this.debug) {
8902
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
8903
- }
8904
- const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);
8905
- updatedDraftState.changes.previousConfiguration = configurationDto;
8906
- }
8907
- if (currentState.contentHash !== publishedState.contentHash) {
8908
- if (this.debug) {
8909
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);
8910
- }
8911
- updatedDraftState.changes.previousContentHash = publishedState.contentHash;
8912
- }
8913
- if (Object.keys(updatedDraftState.changes).length) {
8914
- return updatedDraftState;
8915
- }
8916
- return void 0;
8917
- }
8918
- buildGroupApprovalStates(groups, groupSnapshots) {
8919
- const result = /* @__PURE__ */ new Map();
8920
- const allGroups = [...groups, ...groupSnapshots];
8921
- for (const g of allGroups) {
8922
- const approvalState = {
8923
- approvalState: "Approved",
8924
- designSystemVersionId: g.designSystemVersionId,
8925
- persistentId: g.persistentId,
8926
- groupId: g.id
8927
- };
8928
- result.set(g.id, approvalState);
8929
- }
8930
- return result;
8860
+ return computeDocsHierarchy(doc.getState(), options);
8931
8861
  }
8932
8862
  //
8933
8863
  // Update page content hash
@@ -8963,19 +8893,6 @@ var FrontendVersionRoomYDoc = class {
8963
8893
  const settings = doc.getDocumentationInternalSettings();
8964
8894
  return settings.approvalRequiredForPublishing;
8965
8895
  }
8966
- buildPageApprovalStates(pages) {
8967
- const doc = new VersionRoomBaseYDoc(this.yDoc);
8968
- const pageIds = pages.map((p) => p.id);
8969
- const result = /* @__PURE__ */ new Map();
8970
- const approvals = doc.getApprovals();
8971
- for (const pId of pageIds) {
8972
- const approval = approvals.find((approval2) => approval2.pageId === pId);
8973
- if (approval) {
8974
- result.set(pId, approval);
8975
- }
8976
- }
8977
- return result;
8978
- }
8979
8896
  };
8980
8897
 
8981
8898
  // src/yjs/design-system-content/documentation-hierarchy.ts
@@ -9002,7 +8919,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
9002
8919
  function itemConfigurationToYjs(yDoc, item) {
9003
8920
  yDoc.transact((trx) => {
9004
8921
  const { title, configuration } = item;
9005
- const header = _optionalChain([configuration, 'optionalAccess', _40 => _40.header]);
8922
+ const header = _optionalChain([configuration, 'optionalAccess', _41 => _41.header]);
9006
8923
  if (title !== void 0) {
9007
8924
  const headerYMap = trx.doc.getMap("itemTitle");
9008
8925
  headerYMap.set("title", title);
@@ -9020,9 +8937,9 @@ function itemConfigurationToYjs(yDoc, item) {
9020
8937
  header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
9021
8938
  }
9022
8939
  const configYMap = trx.doc.getMap("itemConfiguration");
9023
- _optionalChain([configuration, 'optionalAccess', _41 => _41.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
9024
- _optionalChain([configuration, 'optionalAccess', _42 => _42.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
9025
- _optionalChain([configuration, 'optionalAccess', _43 => _43.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
8940
+ _optionalChain([configuration, 'optionalAccess', _42 => _42.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
8941
+ _optionalChain([configuration, 'optionalAccess', _43 => _43.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
8942
+ _optionalChain([configuration, 'optionalAccess', _44 => _44.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
9026
8943
  });
9027
8944
  }
9028
8945
  function yjsToItemConfiguration(yDoc) {
@@ -9879,7 +9796,7 @@ var ListTreeBuilder = class {
9879
9796
  }
9880
9797
  addWithProperty(block, multiRichTextProperty) {
9881
9798
  const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
9882
- return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _44 => _44.multiRichTextStyle]) || "OL");
9799
+ return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _45 => _45.multiRichTextStyle]) || "OL");
9883
9800
  }
9884
9801
  add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
9885
9802
  const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
@@ -9894,7 +9811,7 @@ var ListTreeBuilder = class {
9894
9811
  }
9895
9812
  const listParent = this.getParentOfDepth(block.data.indentLevel);
9896
9813
  const lastChild = listParent.children[listParent.children.length - 1];
9897
- if (_optionalChain([lastChild, 'optionalAccess', _45 => _45.type]) === "List") {
9814
+ if (_optionalChain([lastChild, 'optionalAccess', _46 => _46.type]) === "List") {
9898
9815
  lastChild.children.push(...list.leadingChildren);
9899
9816
  return;
9900
9817
  } else {
@@ -10125,7 +10042,7 @@ function serializeAsRichTextBlock(input) {
10125
10042
  const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
10126
10043
  const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
10127
10044
  const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
10128
- const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _46 => _46.richTextStyle]), () => ( "Default"));
10045
+ const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _47 => _47.richTextStyle]), () => ( "Default"));
10129
10046
  switch (style) {
10130
10047
  case "Callout":
10131
10048
  return serializeAsCallout(enrichedInput);
@@ -10349,7 +10266,7 @@ function serializeBlockNodeAttributes(block) {
10349
10266
  };
10350
10267
  }
10351
10268
  function richTextHeadingLevel(property) {
10352
- const style = _optionalChain([property, 'access', _47 => _47.options, 'optionalAccess', _48 => _48.richTextStyle]);
10269
+ const style = _optionalChain([property, 'access', _48 => _48.options, 'optionalAccess', _49 => _49.richTextStyle]);
10353
10270
  if (!style)
10354
10271
  return void 0;
10355
10272
  switch (style) {
@@ -10470,7 +10387,7 @@ function serializeAsCustomBlock(block, definition) {
10470
10387
  linksTo: i.linksTo
10471
10388
  };
10472
10389
  });
10473
- const columns = _optionalChain([block, 'access', _49 => _49.data, 'access', _50 => _50.appearance, 'optionalAccess', _51 => _51.numberOfColumns]);
10390
+ const columns = _optionalChain([block, 'access', _50 => _50.data, 'access', _51 => _51.appearance, 'optionalAccess', _52 => _52.numberOfColumns]);
10474
10391
  return {
10475
10392
  type: serializeCustomBlockNodeType(block, definition),
10476
10393
  attrs: {
@@ -12667,7 +12584,7 @@ function parseAsListNode(prosemirrorNode) {
12667
12584
  function parseAsListNodeItem(prosemirrorNode) {
12668
12585
  if (prosemirrorNode.type !== "listItem")
12669
12586
  return null;
12670
- const firstChild = _optionalChain([prosemirrorNode, 'access', _52 => _52.content, 'optionalAccess', _53 => _53[0]]);
12587
+ const firstChild = _optionalChain([prosemirrorNode, 'access', _53 => _53.content, 'optionalAccess', _54 => _54[0]]);
12671
12588
  if (!firstChild || firstChild.type !== "paragraph")
12672
12589
  return null;
12673
12590
  return parseRichText(_nullishCoalesce(firstChild.content, () => ( [])));
@@ -12822,10 +12739,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
12822
12739
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12823
12740
  const result = [];
12824
12741
  const listItems = [];
12825
- _optionalChain([prosemirrorNode, 'access', _54 => _54.content, 'optionalAccess', _55 => _55.forEach, 'call', _56 => _56((c) => {
12742
+ _optionalChain([prosemirrorNode, 'access', _55 => _55.content, 'optionalAccess', _56 => _56.forEach, 'call', _57 => _57((c) => {
12826
12743
  if (c.type !== "listItem")
12827
12744
  return;
12828
- _optionalChain([c, 'access', _57 => _57.content, 'optionalAccess', _58 => _58.forEach, 'call', _59 => _59((cc) => {
12745
+ _optionalChain([c, 'access', _58 => _58.content, 'optionalAccess', _59 => _59.forEach, 'call', _60 => _60((cc) => {
12829
12746
  listItems.push(cc);
12830
12747
  })]);
12831
12748
  })]);
@@ -12941,17 +12858,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
12941
12858
  return null;
12942
12859
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12943
12860
  const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
12944
- const tableChild = _optionalChain([prosemirrorNode, 'access', _60 => _60.content, 'optionalAccess', _61 => _61.find, 'call', _62 => _62((c) => c.type === "table")]);
12861
+ const tableChild = _optionalChain([prosemirrorNode, 'access', _61 => _61.content, 'optionalAccess', _62 => _62.find, 'call', _63 => _63((c) => c.type === "table")]);
12945
12862
  if (!tableChild) {
12946
12863
  return emptyTable(id, variantId, 0);
12947
12864
  }
12948
- const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _63 => _63.content, 'optionalAccess', _64 => _64.filter, 'call', _65 => _65((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _66 => _66.content, 'optionalAccess', _67 => _67.length]))]), () => ( []));
12865
+ const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _64 => _64.content, 'optionalAccess', _65 => _65.filter, 'call', _66 => _66((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _67 => _67.content, 'optionalAccess', _68 => _68.length]))]), () => ( []));
12949
12866
  if (!rows.length) {
12950
12867
  return emptyTable(id, variantId, 0);
12951
12868
  }
12952
- const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _68 => _68[0], 'access', _69 => _69.content, 'optionalAccess', _70 => _70.filter, 'call', _71 => _71((c) => c.type === "tableHeader"), 'access', _72 => _72.length]), () => ( 0));
12953
- const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _73 => _73.content, 'optionalAccess', _74 => _74[0], 'optionalAccess', _75 => _75.type]) === "tableHeader").length;
12954
- const hasHeaderRow = _optionalChain([rows, 'access', _76 => _76[0], 'access', _77 => _77.content, 'optionalAccess', _78 => _78.length]) === rowHeaderCells;
12869
+ const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _69 => _69[0], 'access', _70 => _70.content, 'optionalAccess', _71 => _71.filter, 'call', _72 => _72((c) => c.type === "tableHeader"), 'access', _73 => _73.length]), () => ( 0));
12870
+ const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _74 => _74.content, 'optionalAccess', _75 => _75[0], 'optionalAccess', _76 => _76.type]) === "tableHeader").length;
12871
+ const hasHeaderRow = _optionalChain([rows, 'access', _77 => _77[0], 'access', _78 => _78.content, 'optionalAccess', _79 => _79.length]) === rowHeaderCells;
12955
12872
  const hasHeaderColumn = rows.length === columnHeaderCells;
12956
12873
  const tableValue = {
12957
12874
  showBorder: hasBorder,
@@ -13033,7 +12950,7 @@ function parseAsTableNode(prosemirrorNode) {
13033
12950
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
13034
12951
  if (!parsedItems.success)
13035
12952
  return null;
13036
- const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _79 => _79.data, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.props, 'access', _82 => _82.image]);
12953
+ const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _80 => _80.data, 'access', _81 => _81[0], 'optionalAccess', _82 => _82.props, 'access', _83 => _83.image]);
13037
12954
  if (!rawImagePropertyValue)
13038
12955
  return null;
13039
12956
  const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
@@ -13274,7 +13191,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
13274
13191
  return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
13275
13192
  }
13276
13193
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
13277
- const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _83 => _83.attrs, 'optionalAccess', _84 => _84[attributeName]]));
13194
+ const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _84 => _84.attrs, 'optionalAccess', _85 => _85[attributeName]]));
13278
13195
  if (parsedAttr.success) {
13279
13196
  return parsedAttr.data;
13280
13197
  } else {
@@ -13318,7 +13235,6 @@ var BackendVersionRoomYDoc = class {
13318
13235
  transaction.pageHashesToUpdate && yDoc.updateDocumentationPageContentHashes(transaction.pageHashesToUpdate);
13319
13236
  transaction.pageApprovals && yDoc.updateApprovalStates(transaction.pageApprovals);
13320
13237
  transaction.pageApprovalIdsToDelete && yDoc.removeApprovalStates(transaction.pageApprovalIdsToDelete);
13321
- transaction.executedTransactionIds && yDoc.updateExecutedTransactionIds(transaction.executedTransactionIds);
13322
13238
  });
13323
13239
  }
13324
13240
  getDocumentationPageContentHashes() {
@@ -13330,11 +13246,570 @@ var BackendVersionRoomYDoc = class {
13330
13246
  }
13331
13247
  };
13332
13248
 
13249
+ // src/sync/local-state.ts
13250
+ var LocalStorage = class {
13251
+ constructor() {
13252
+ __publicField(this, "pages", /* @__PURE__ */ new Map());
13253
+ __publicField(this, "liveblocksRoomIds", /* @__PURE__ */ new Map());
13254
+ __publicField(this, "deletedPageIds", /* @__PURE__ */ new Set());
13255
+ __publicField(this, "groups", /* @__PURE__ */ new Map());
13256
+ }
13257
+ setPage(page) {
13258
+ if (this.pages.has(page.persistentId)) {
13259
+ throw new Error(`Page with id ${page.persistentId} already exists`);
13260
+ }
13261
+ this.pages.set(page.persistentId, page);
13262
+ }
13263
+ deletePage(persistentId) {
13264
+ this.pages.delete(persistentId);
13265
+ this.deletedPageIds.add(persistentId);
13266
+ }
13267
+ tryGetPage(persistentId) {
13268
+ return this.pages.get(persistentId);
13269
+ }
13270
+ getPage(persistentId) {
13271
+ const page = this.tryGetPage(persistentId);
13272
+ if (!page)
13273
+ throw new Error(`Page with id ${persistentId} doesn't exist`);
13274
+ return page;
13275
+ }
13276
+ getAllPages() {
13277
+ return Array.from(this.pages.values());
13278
+ }
13279
+ getAllDeletedPages() {
13280
+ return this.deletedPageIds;
13281
+ }
13282
+ removePage(persistentId) {
13283
+ this.pages.delete(persistentId);
13284
+ }
13285
+ setPageLiveblocksRoomId(pagePersistentId, id) {
13286
+ this.liveblocksRoomIds.set(pagePersistentId, id);
13287
+ }
13288
+ getPageLiveblocksRoomId(pagePersistentId) {
13289
+ return this.liveblocksRoomIds.get(pagePersistentId);
13290
+ }
13291
+ getAllPageLiveblocksRoomIds() {
13292
+ return this.liveblocksRoomIds;
13293
+ }
13294
+ };
13333
13295
 
13296
+ // src/sync/docs-structure-repo.ts
13297
+ var DocsStructureRepository = class {
13298
+ constructor(designSystemVersionId, yDoc, transactionExecutor) {
13299
+ __publicField(this, "localState", new LocalStorage());
13300
+ __publicField(this, "designSystemVersionId");
13301
+ __publicField(this, "yDoc");
13302
+ __publicField(this, "yObserver");
13303
+ __publicField(this, "_yState");
13304
+ __publicField(this, "_currentHierarchy");
13305
+ __publicField(this, "trxQueue");
13306
+ __publicField(this, "hierarchyObservers", /* @__PURE__ */ new Set());
13307
+ __publicField(this, "initCallbacks", /* @__PURE__ */ new Set());
13308
+ this.designSystemVersionId = designSystemVersionId;
13309
+ this.yDoc = yDoc;
13310
+ this.yObserver = yDoc.on("update", () => this.onYUpdate());
13311
+ this.onYUpdate();
13312
+ this.trxQueue = new TransactionQueue(transactionExecutor);
13313
+ }
13314
+ //
13315
+ // Convenience
13316
+ //
13317
+ get yState() {
13318
+ const yState = this._yState;
13319
+ if (!yState)
13320
+ throw SupernovaException.shouldNotHappen(`Accessing Y state before it was loaded`);
13321
+ return yState;
13322
+ }
13323
+ //
13324
+ // Lifecycle
13325
+ //
13326
+ get isInitialized() {
13327
+ return !!this._currentHierarchy;
13328
+ }
13329
+ onInitialized() {
13330
+ if (this.isInitialized)
13331
+ return Promise.resolve();
13332
+ return new Promise((resolve) => {
13333
+ this.initCallbacks.add(resolve);
13334
+ });
13335
+ }
13336
+ addHierarchyObserver(observer) {
13337
+ this.hierarchyObservers.add(observer);
13338
+ if (this._currentHierarchy)
13339
+ observer(this._currentHierarchy);
13340
+ }
13341
+ removeHierarchyObserver(observer) {
13342
+ this.hierarchyObservers.delete(observer);
13343
+ }
13344
+ dispose() {
13345
+ this.yDoc.off("update", this.yObserver);
13346
+ this.hierarchyObservers.clear();
13347
+ this.trxQueue.clear();
13348
+ }
13349
+ //
13350
+ // Accessors
13351
+ //
13352
+ get currentHierarchy() {
13353
+ const hierarchy = this._currentHierarchy;
13354
+ if (!hierarchy)
13355
+ throw new Error(`Hierarchy cannot be accessed while it's still loading`);
13356
+ return hierarchy;
13357
+ }
13358
+ //
13359
+ // Actions
13360
+ //
13361
+ createPage(input) {
13362
+ void this.createPagePromise(input);
13363
+ }
13364
+ createPagePromise(input) {
13365
+ this.localState.setPage({
13366
+ createdAt: /* @__PURE__ */ new Date(),
13367
+ parentPersistentId: input.parentPersistentId,
13368
+ persistentId: input.persistentId,
13369
+ shortPersistentId: generateShortPersistentId(),
13370
+ slug: slugify(input.title),
13371
+ meta: { name: input.title },
13372
+ updatedAt: /* @__PURE__ */ new Date(),
13373
+ data: { configuration: input.configuration },
13374
+ sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),
13375
+ designSystemVersionId: ""
13376
+ });
13377
+ this.localState.setPageLiveblocksRoomId(
13378
+ input.persistentId,
13379
+ `${RoomType.DocumentationPage}:${this.designSystemVersionId}:${input.persistentId}`
13380
+ );
13381
+ this.refreshHierarchy();
13382
+ return this.trxQueue.enqueue({
13383
+ type: "DocumentationPageCreate",
13384
+ input: {
13385
+ persistentId: input.persistentId,
13386
+ parentPersistentId: input.parentPersistentId,
13387
+ title: input.title,
13388
+ afterPersistentId: input.afterPersistentId,
13389
+ configuration: input.configuration
13390
+ }
13391
+ });
13392
+ }
13393
+ updatePage(update) {
13394
+ void this.updatePagePromise(update);
13395
+ }
13396
+ updatePagePromise(update) {
13397
+ this.updatePageLocally(update);
13398
+ this.refreshHierarchy();
13399
+ return this.trxQueue.enqueue({
13400
+ type: "DocumentationPageUpdate",
13401
+ input: {
13402
+ id: update.persistentId,
13403
+ configuration: update.configuration,
13404
+ title: update.title
13405
+ }
13406
+ });
13407
+ }
13408
+ updatePageLocally(update) {
13409
+ const basePage = this.lookupPage(update.persistentId);
13410
+ this.localState.setPage(this.createLocalPageUpdate(basePage, update));
13411
+ }
13412
+ deletePagePromise(persistentId) {
13413
+ this.lookupPage(persistentId);
13414
+ this.localState.deletePage(persistentId);
13415
+ this.refreshHierarchy();
13416
+ return this.trxQueue.enqueue({
13417
+ type: "DocumentationPageDelete",
13418
+ input: {
13419
+ id: persistentId
13420
+ }
13421
+ });
13422
+ }
13423
+ deletePage(persistentId) {
13424
+ void this.deletePagePromise(persistentId);
13425
+ }
13426
+ createLocalPageUpdate(basePage, update) {
13427
+ let updatedConfiguration = basePage.data.configuration;
13428
+ if (update.configuration && Object.keys(update.configuration).length) {
13429
+ updatedConfiguration = { ..._nullishCoalesce(updatedConfiguration, () => ( defaultDocumentationItemConfigurationV2)) };
13430
+ updatedConfiguration.header = _nullishCoalesce(update.configuration.header, () => ( updatedConfiguration.header));
13431
+ updatedConfiguration.isHidden = _nullishCoalesce(update.configuration.isHidden, () => ( updatedConfiguration.isHidden));
13432
+ updatedConfiguration.isPrivate = _nullishCoalesce(update.configuration.isPrivate, () => ( updatedConfiguration.isPrivate));
13433
+ updatedConfiguration.showSidebar = _nullishCoalesce(update.configuration.showSidebar, () => ( updatedConfiguration.showSidebar));
13434
+ }
13435
+ return {
13436
+ createdAt: basePage.createdAt,
13437
+ data: {
13438
+ configuration: updatedConfiguration
13439
+ },
13440
+ designSystemVersionId: basePage.designSystemVersionId,
13441
+ meta: { name: _nullishCoalesce(update.title, () => ( basePage.meta.name)) },
13442
+ parentPersistentId: basePage.parentPersistentId,
13443
+ persistentId: basePage.persistentId,
13444
+ shortPersistentId: basePage.shortPersistentId,
13445
+ sortOrder: basePage.sortOrder,
13446
+ updatedAt: /* @__PURE__ */ new Date(),
13447
+ slug: basePage.slug
13448
+ };
13449
+ }
13450
+ lookupPage(persistentId) {
13451
+ const localPageToUpdate = this.localState.tryGetPage(persistentId);
13452
+ if (localPageToUpdate)
13453
+ return localPageToUpdate;
13454
+ const remotePage = this.yState.pages.find((p) => p.persistentId === persistentId);
13455
+ if (remotePage)
13456
+ return remotePage;
13457
+ throw SupernovaException.notFound(`Page ${persistentId} was not found`);
13458
+ }
13459
+ //
13460
+ // Reactions
13461
+ //
13462
+ refreshHierarchy() {
13463
+ const hierarchy = this.calculateHierarchy();
13464
+ if (!hierarchy)
13465
+ return;
13466
+ this._currentHierarchy = hierarchy;
13467
+ this.initCallbacks.forEach((f) => f());
13468
+ this.initCallbacks.clear();
13469
+ this.hierarchyObservers.forEach((o) => o(hierarchy));
13470
+ }
13471
+ calculateHierarchy() {
13472
+ const yState = this._yState;
13473
+ if (!yState)
13474
+ return;
13475
+ const allPagesById = mapByUnique(yState.pages, (p) => p.persistentId);
13476
+ this.localState.getAllPages().forEach((p) => {
13477
+ allPagesById.set(p.persistentId, p);
13478
+ });
13479
+ this.localState.getAllDeletedPages().forEach((id) => allPagesById.delete(id));
13480
+ const pageLiveblockRoomIds = { ...this.yState.pageLiveblockRoomIds };
13481
+ this.localState.getAllPageLiveblocksRoomIds().forEach((v, k) => {
13482
+ pageLiveblockRoomIds[k] = v;
13483
+ });
13484
+ const hierarchy = computeDocsHierarchy({
13485
+ approvals: yState.approvals,
13486
+ groups: yState.groups,
13487
+ groupSnapshots: yState.groupSnapshots,
13488
+ pageContentHashes: yState.pageContentHashes,
13489
+ pages: Array.from(allPagesById.values()),
13490
+ pageSnapshots: yState.pageSnapshots,
13491
+ settings: yState.settings,
13492
+ pageLiveblockRoomIds
13493
+ });
13494
+ return hierarchy;
13495
+ }
13496
+ onYUpdate() {
13497
+ const newState = new VersionRoomBaseYDoc(this.yDoc).getState();
13498
+ if (newState.groups.length) {
13499
+ this._yState = newState;
13500
+ this.refreshHierarchy();
13501
+ }
13502
+ }
13503
+ //
13504
+ // Utils
13505
+ //
13506
+ calculateSortOrder(parentPersistentId, afterPersistentId) {
13507
+ const sortOrderStep = Math.pow(2, 16);
13508
+ const neighbours = [
13509
+ ...this.yState.pages.filter((p) => p.parentPersistentId === parentPersistentId),
13510
+ ...this.yState.groups.filter((g) => g.parentPersistentId === parentPersistentId)
13511
+ ];
13512
+ if (!neighbours.length)
13513
+ return 0;
13514
+ neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);
13515
+ if (afterPersistentId === null)
13516
+ return neighbours[0].sortOrder - sortOrderStep;
13517
+ if (!afterPersistentId)
13518
+ return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13519
+ const index = neighbours.findIndex((e) => e.persistentId === afterPersistentId);
13520
+ if (index < 0 || index === neighbours.length - 1) {
13521
+ return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13522
+ }
13523
+ const left = neighbours[index].sortOrder;
13524
+ const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _86 => _86[index + 1], 'optionalAccess', _87 => _87.sortOrder]), () => ( left + sortOrderStep * 2));
13525
+ return (right + left) / 2;
13526
+ }
13527
+ };
13528
+ var TransactionQueue = class {
13529
+ constructor(executor) {
13530
+ __publicField(this, "executor");
13531
+ __publicField(this, "queue", new (0, _pqueue2.default)({
13532
+ concurrency: 1
13533
+ }));
13534
+ this.executor = executor;
13535
+ }
13536
+ enqueue(trx) {
13537
+ return this.queue.add(() => this.executor(trx));
13538
+ }
13539
+ onEmpty() {
13540
+ return this.queue.onEmpty();
13541
+ }
13542
+ clear() {
13543
+ this.queue.clear();
13544
+ }
13545
+ };
13334
13546
 
13547
+ // src/sync-v2/docs-structure-repo.ts
13335
13548
 
13336
13549
 
13550
+ // src/sync-v2/local-action-executor.ts
13551
+ function applyActionsLocally(versionId, remoteState, trx) {
13552
+ const actionExecutor = new LocalDocsElementActionExecutor(versionId, remoteState);
13553
+ actionExecutor.applyTransactions(trx);
13554
+ return actionExecutor.localState;
13555
+ }
13556
+ var LocalDocsElementActionExecutor = class {
13557
+ constructor(designSystemVersionId, remoteState) {
13558
+ __publicField(this, "designSystemVersionId");
13559
+ __publicField(this, "pages");
13560
+ __publicField(this, "groups");
13561
+ this.designSystemVersionId = designSystemVersionId;
13562
+ this.pages = mapByUnique(remoteState.pages, (p) => p.persistentId);
13563
+ this.groups = mapByUnique(remoteState.groups, (p) => p.persistentId);
13564
+ }
13565
+ get localState() {
13566
+ return {
13567
+ pages: Array.from(this.pages.values()),
13568
+ groups: Array.from(this.groups.values())
13569
+ };
13570
+ }
13571
+ applyTransactions(trx) {
13572
+ trx.forEach((trx2) => this.applyTransaction(trx2));
13573
+ }
13574
+ applyTransaction(trx) {
13575
+ switch (trx.type) {
13576
+ case "DocumentationGroupCreate":
13577
+ case "DocumentationGroupDelete":
13578
+ case "DocumentationGroupDuplicate":
13579
+ case "DocumentationGroupMove":
13580
+ case "DocumentationGroupRestore":
13581
+ case "DocumentationGroupUpdate":
13582
+ throw new Error(`Transaction type ${trx.type} is not yet implemented`);
13583
+ case "DocumentationPageCreate":
13584
+ return this.documentationPageCreate(trx);
13585
+ case "DocumentationPageUpdate":
13586
+ return this.documentationPageUpdate(trx);
13587
+ case "DocumentationPageMove":
13588
+ return this.documentationPageMove(trx);
13589
+ case "DocumentationPageDelete":
13590
+ return this.documentationPageDelete(trx);
13591
+ case "DocumentationPageApprovalStateChange":
13592
+ case "DocumentationPageDuplicate":
13593
+ case "DocumentationPageRestore":
13594
+ throw new Error(`Transaction type ${trx.type} is not yet implemented`);
13595
+ case "DocumentationTabCreate":
13596
+ case "DocumentationTabGroupDelete":
13597
+ throw new Error(`Transaction type ${trx.type} is not yet implemented`);
13598
+ case "FigmaNodeRender":
13599
+ case "FigmaNodeRenderAsync":
13600
+ throw new Error(`Transaction type ${trx.type} is not a documentation element action`);
13601
+ }
13602
+ }
13603
+ documentationPageCreate(trx) {
13604
+ const { input } = trx;
13605
+ if (this.pages.has(input.persistentId)) {
13606
+ return;
13607
+ }
13608
+ const localPage = {
13609
+ createdAt: /* @__PURE__ */ new Date(),
13610
+ parentPersistentId: input.parentPersistentId,
13611
+ persistentId: input.persistentId,
13612
+ shortPersistentId: generateShortPersistentId(),
13613
+ slug: slugify(input.title),
13614
+ meta: { name: input.title },
13615
+ updatedAt: /* @__PURE__ */ new Date(),
13616
+ data: {
13617
+ // TODO Artem: move somewhere reusable
13618
+ configuration: input.configuration ? { ...defaultDocumentationItemConfigurationV2, ...input.configuration } : input.configuration
13619
+ },
13620
+ sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),
13621
+ designSystemVersionId: this.designSystemVersionId
13622
+ };
13623
+ this.pages.set(localPage.persistentId, localPage);
13624
+ }
13625
+ documentationPageUpdate(trx) {
13626
+ const { input } = trx;
13627
+ const existingPage = this.pages.get(input.id);
13628
+ if (!existingPage) {
13629
+ throw new Error(`Cannot update page: page id ${input.id} was not found`);
13630
+ }
13631
+ const localPage = {
13632
+ ...existingPage,
13633
+ userSlug: void 0,
13634
+ meta: {
13635
+ ...existingPage.meta,
13636
+ name: _nullishCoalesce(input.title, () => ( existingPage.meta.name))
13637
+ },
13638
+ data: {
13639
+ // TODO Artem: move somewhere reusable
13640
+ configuration: input.configuration ? { ..._nullishCoalesce(existingPage.data.configuration, () => ( defaultDocumentationItemConfigurationV2)), ...input.configuration } : existingPage.data.configuration
13641
+ }
13642
+ };
13643
+ this.pages.set(localPage.persistentId, localPage);
13644
+ }
13645
+ documentationPageMove(trx) {
13646
+ const { input } = trx;
13647
+ if (!this.groups.has(input.parentPersistentId)) {
13648
+ throw new Error(`Cannot move page: page parent id ${input.parentPersistentId} was not found`);
13649
+ }
13650
+ const existingPage = this.pages.get(input.id);
13651
+ if (!existingPage) {
13652
+ throw new Error(`Cannot update page: page id ${input.id} was not found`);
13653
+ }
13654
+ const localPage = {
13655
+ ...existingPage,
13656
+ userSlug: void 0,
13657
+ sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),
13658
+ parentPersistentId: input.parentPersistentId
13659
+ };
13660
+ this.pages.set(localPage.persistentId, localPage);
13661
+ }
13662
+ documentationPageDelete(trx) {
13663
+ const { input } = trx;
13664
+ if (!this.pages.delete(trx.input.id)) {
13665
+ throw new Error(`Cannot delete page: page id ${input.id} was not found`);
13666
+ }
13667
+ }
13668
+ //
13669
+ // Utils
13670
+ //
13671
+ calculateSortOrder(parentPersistentId, afterPersistentId) {
13672
+ const sortOrderStep = Math.pow(2, 16);
13673
+ const neighbours = [
13674
+ ...Array.from(this.pages.values()).filter((p) => p.parentPersistentId === parentPersistentId),
13675
+ ...Array.from(this.groups.values()).filter((g) => g.parentPersistentId === parentPersistentId)
13676
+ ];
13677
+ if (!neighbours.length)
13678
+ return 0;
13679
+ neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);
13680
+ if (afterPersistentId === null)
13681
+ return neighbours[0].sortOrder - sortOrderStep;
13682
+ if (!afterPersistentId)
13683
+ return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13684
+ const index = neighbours.findIndex((e) => e.persistentId === afterPersistentId);
13685
+ if (index < 0 || index === neighbours.length - 1) {
13686
+ return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13687
+ }
13688
+ const left = neighbours[index].sortOrder;
13689
+ const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _88 => _88[index + 1], 'optionalAccess', _89 => _89.sortOrder]), () => ( left + sortOrderStep * 2));
13690
+ return (right + left) / 2;
13691
+ }
13692
+ };
13337
13693
 
13694
+ // src/sync-v2/docs-structure-repo.ts
13695
+ var DocsStructureRepositoryV2 = class {
13696
+ constructor(designSystemVersionId, yDoc, transactionExecutor) {
13697
+ __publicField(this, "designSystemVersionId");
13698
+ __publicField(this, "yDoc");
13699
+ __publicField(this, "yObserver");
13700
+ __publicField(this, "_yState");
13701
+ __publicField(this, "_currentHierarchy");
13702
+ __publicField(this, "localActions", []);
13703
+ __publicField(this, "actionQueue");
13704
+ __publicField(this, "hierarchyObservers", /* @__PURE__ */ new Set());
13705
+ __publicField(this, "initCallbacks", /* @__PURE__ */ new Set());
13706
+ this.designSystemVersionId = designSystemVersionId;
13707
+ this.yDoc = yDoc;
13708
+ this.yObserver = yDoc.on("update", () => this.onYUpdate());
13709
+ this.onYUpdate();
13710
+ this.actionQueue = new TransactionQueue2(transactionExecutor);
13711
+ }
13712
+ //
13713
+ // Lifecycle
13714
+ //
13715
+ get isInitialized() {
13716
+ return !!this._currentHierarchy;
13717
+ }
13718
+ onInitialized() {
13719
+ if (this.isInitialized)
13720
+ return Promise.resolve();
13721
+ return new Promise((resolve) => {
13722
+ this.initCallbacks.add(resolve);
13723
+ });
13724
+ }
13725
+ addHierarchyObserver(observer) {
13726
+ this.hierarchyObservers.add(observer);
13727
+ if (this._currentHierarchy)
13728
+ observer(this._currentHierarchy);
13729
+ }
13730
+ removeHierarchyObserver(observer) {
13731
+ this.hierarchyObservers.delete(observer);
13732
+ }
13733
+ dispose() {
13734
+ this.yDoc.off("update", this.yObserver);
13735
+ this.hierarchyObservers.clear();
13736
+ this.actionQueue.clear();
13737
+ }
13738
+ //
13739
+ // Accessors
13740
+ //
13741
+ get currentHierarchy() {
13742
+ const hierarchy = this._currentHierarchy;
13743
+ if (!hierarchy)
13744
+ throw new Error(`Hierarchy cannot be accessed while it's still loading`);
13745
+ return hierarchy;
13746
+ }
13747
+ //
13748
+ // Actions
13749
+ //
13750
+ executeAction(action) {
13751
+ void this.executeActionPromise(action);
13752
+ }
13753
+ executeActionPromise(action) {
13754
+ this.localActions.push(action);
13755
+ this.refreshHierarchy();
13756
+ return this.actionQueue.enqueue(action);
13757
+ }
13758
+ //
13759
+ // Reactions
13760
+ //
13761
+ refreshHierarchy() {
13762
+ const hierarchy = this.calculateHierarchy();
13763
+ if (!hierarchy)
13764
+ return;
13765
+ this._currentHierarchy = hierarchy;
13766
+ this.initCallbacks.forEach((f) => f());
13767
+ this.initCallbacks.clear();
13768
+ this.hierarchyObservers.forEach((o) => o(hierarchy));
13769
+ }
13770
+ calculateHierarchy() {
13771
+ const yState = this._yState;
13772
+ if (!yState)
13773
+ return;
13774
+ const { pages, groups } = applyActionsLocally(this.designSystemVersionId, yState, this.localActions);
13775
+ const hierarchy = computeDocsHierarchy({
13776
+ pages,
13777
+ groups,
13778
+ approvals: yState.approvals,
13779
+ groupSnapshots: yState.groupSnapshots,
13780
+ pageContentHashes: yState.pageContentHashes,
13781
+ pageSnapshots: yState.pageSnapshots,
13782
+ settings: yState.settings,
13783
+ pageLiveblockRoomIds: yState.pageLiveblockRoomIds
13784
+ });
13785
+ return hierarchy;
13786
+ }
13787
+ onYUpdate() {
13788
+ const newState = new VersionRoomBaseYDoc(this.yDoc).getState();
13789
+ if (newState.groups.length) {
13790
+ this._yState = newState;
13791
+ this.refreshHierarchy();
13792
+ }
13793
+ }
13794
+ };
13795
+ var TransactionQueue2 = class {
13796
+ constructor(executor) {
13797
+ __publicField(this, "executor");
13798
+ __publicField(this, "queue", new (0, _pqueue2.default)({
13799
+ concurrency: 1
13800
+ }));
13801
+ this.executor = executor;
13802
+ }
13803
+ enqueue(trx) {
13804
+ return this.queue.add(() => this.executor(trx));
13805
+ }
13806
+ onEmpty() {
13807
+ return this.queue.onEmpty();
13808
+ }
13809
+ clear() {
13810
+ this.queue.clear();
13811
+ }
13812
+ };
13338
13813
 
13339
13814
 
13340
13815
 
@@ -13744,7 +14219,5 @@ var BackendVersionRoomYDoc = class {
13744
14219
 
13745
14220
 
13746
14221
 
13747
-
13748
-
13749
- exports.BackendVersionRoomYDoc = BackendVersionRoomYDoc; exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.BrandsEndpoint = BrandsEndpoint; exports.CodegenEndpoint = CodegenEndpoint; exports.Collection = Collection2; exports.DTOAppBootstrapDataQuery = DTOAppBootstrapDataQuery; exports.DTOAppBootstrapDataResponse = DTOAppBootstrapDataResponse; exports.DTOAssetRenderConfiguration = DTOAssetRenderConfiguration; exports.DTOAuthenticatedUser = DTOAuthenticatedUser; exports.DTOAuthenticatedUserProfile = DTOAuthenticatedUserProfile; exports.DTOAuthenticatedUserResponse = DTOAuthenticatedUserResponse; exports.DTOBffFigmaImportRequestBody = DTOBffFigmaImportRequestBody; exports.DTOBffImportRequestBody = DTOBffImportRequestBody; exports.DTOBffUploadImportRequestBody = DTOBffUploadImportRequestBody; exports.DTOBrand = DTOBrand; exports.DTOBrandCreatePayload = DTOBrandCreatePayload; exports.DTOBrandCreateResponse = DTOBrandCreateResponse; exports.DTOBrandGetResponse = DTOBrandGetResponse; exports.DTOBrandUpdatePayload = DTOBrandUpdatePayload; exports.DTOBrandsListResponse = DTOBrandsListResponse; exports.DTOColorTokenInlineData = DTOColorTokenInlineData; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTOCreateDocumentationTabInput = DTOCreateDocumentationTabInput; exports.DTOCreateVersionInput = DTOCreateVersionInput; exports.DTODataSource = DTODataSource; exports.DTODataSourceFigma = DTODataSourceFigma; exports.DTODataSourceFigmaCloud = DTODataSourceFigmaCloud; exports.DTODataSourceFigmaCreatePayload = DTODataSourceFigmaCreatePayload; exports.DTODataSourceFigmaImportPayload = DTODataSourceFigmaImportPayload; exports.DTODataSourceFigmaScope = DTODataSourceFigmaScope; exports.DTODataSourceFigmaVariablesPlugin = DTODataSourceFigmaVariablesPlugin; exports.DTODataSourceResponse = DTODataSourceResponse; exports.DTODataSourceTokenStudio = DTODataSourceTokenStudio; exports.DTODataSourcesListResponse = DTODataSourcesListResponse; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODeleteDocumentationTabGroupInput = DTODeleteDocumentationTabGroupInput; exports.DTODesignElementsDataDiffResponse = DTODesignElementsDataDiffResponse; exports.DTODesignSystem = DTODesignSystem; exports.DTODesignSystemComponent = DTODesignSystemComponent; exports.DTODesignSystemComponentCreateInput = DTODesignSystemComponentCreateInput; exports.DTODesignSystemComponentListResponse = DTODesignSystemComponentListResponse; exports.DTODesignSystemComponentResponse = DTODesignSystemComponentResponse; exports.DTODesignSystemContactsResponse = DTODesignSystemContactsResponse; exports.DTODesignSystemCreateInput = DTODesignSystemCreateInput; exports.DTODesignSystemInvitation = DTODesignSystemInvitation; exports.DTODesignSystemMember = DTODesignSystemMember; exports.DTODesignSystemMemberListResponse = DTODesignSystemMemberListResponse; exports.DTODesignSystemMembersUpdatePayload = DTODesignSystemMembersUpdatePayload; exports.DTODesignSystemMembersUpdateResponse = DTODesignSystemMembersUpdateResponse; exports.DTODesignSystemResponse = DTODesignSystemResponse; exports.DTODesignSystemRole = DTODesignSystemRole; exports.DTODesignSystemUpdateAccessModeInput = DTODesignSystemUpdateAccessModeInput; exports.DTODesignSystemUpdateInput = DTODesignSystemUpdateInput; exports.DTODesignSystemVersion = DTODesignSystemVersion; exports.DTODesignSystemVersionCreationResponse = DTODesignSystemVersionCreationResponse; exports.DTODesignSystemVersionGetResponse = DTODesignSystemVersionGetResponse; exports.DTODesignSystemVersionJobStatusResponse = DTODesignSystemVersionJobStatusResponse; exports.DTODesignSystemVersionJobsResponse = DTODesignSystemVersionJobsResponse; exports.DTODesignSystemVersionRoom = DTODesignSystemVersionRoom; exports.DTODesignSystemVersionRoomResponse = DTODesignSystemVersionRoomResponse; exports.DTODesignSystemVersionStats = DTODesignSystemVersionStats; exports.DTODesignSystemVersionStatsQuery = DTODesignSystemVersionStatsQuery; exports.DTODesignSystemVersionsListResponse = DTODesignSystemVersionsListResponse; exports.DTODesignSystemsListResponse = DTODesignSystemsListResponse; exports.DTODesignToken = DTODesignToken; exports.DTODesignTokenCreatePayload = DTODesignTokenCreatePayload; exports.DTODesignTokenGroup = DTODesignTokenGroup; exports.DTODesignTokenGroupCreatePayload = DTODesignTokenGroupCreatePayload; exports.DTODesignTokenGroupListResponse = DTODesignTokenGroupListResponse; exports.DTODesignTokenGroupResponse = DTODesignTokenGroupResponse; exports.DTODesignTokenListResponse = DTODesignTokenListResponse; exports.DTODesignTokenResponse = DTODesignTokenResponse; exports.DTODiffCountBase = DTODiffCountBase; exports.DTODocumentationDraftChangeType = DTODocumentationDraftChangeType; exports.DTODocumentationDraftState = DTODocumentationDraftState; exports.DTODocumentationDraftStateCreated = DTODocumentationDraftStateCreated; exports.DTODocumentationDraftStateDeleted = DTODocumentationDraftStateDeleted; exports.DTODocumentationDraftStateUpdated = DTODocumentationDraftStateUpdated; exports.DTODocumentationGroupApprovalState = DTODocumentationGroupApprovalState; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupMoveActionInputV2 = DTODocumentationGroupMoveActionInputV2; exports.DTODocumentationGroupMoveActionOutputV2 = DTODocumentationGroupMoveActionOutputV2; exports.DTODocumentationGroupRestoreActionInput = DTODocumentationGroupRestoreActionInput; exports.DTODocumentationGroupRestoreActionOutput = DTODocumentationGroupRestoreActionOutput; exports.DTODocumentationGroupStructureV1 = DTODocumentationGroupStructureV1; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationGroupV1 = DTODocumentationGroupV1; exports.DTODocumentationGroupV2 = DTODocumentationGroupV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationItemConfigurationV1 = DTODocumentationItemConfigurationV1; exports.DTODocumentationItemConfigurationV2 = DTODocumentationItemConfigurationV2; exports.DTODocumentationItemHeaderV2 = DTODocumentationItemHeaderV2; exports.DTODocumentationLinkPreviewRequest = DTODocumentationLinkPreviewRequest; exports.DTODocumentationLinkPreviewResponse = DTODocumentationLinkPreviewResponse; exports.DTODocumentationPageAnchor = DTODocumentationPageAnchor; exports.DTODocumentationPageApprovalState = DTODocumentationPageApprovalState; exports.DTODocumentationPageApprovalStateChangeActionInput = DTODocumentationPageApprovalStateChangeActionInput; exports.DTODocumentationPageApprovalStateChangeActionOutput = DTODocumentationPageApprovalStateChangeActionOutput; exports.DTODocumentationPageApprovalStateChangeInput = DTODocumentationPageApprovalStateChangeInput; exports.DTODocumentationPageContent = DTODocumentationPageContent; exports.DTODocumentationPageContentGetResponse = DTODocumentationPageContentGetResponse; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; exports.DTODocumentationPageMoveActionInputV2 = DTODocumentationPageMoveActionInputV2; exports.DTODocumentationPageMoveActionOutputV2 = DTODocumentationPageMoveActionOutputV2; exports.DTODocumentationPageRestoreActionInput = DTODocumentationPageRestoreActionInput; exports.DTODocumentationPageRestoreActionOutput = DTODocumentationPageRestoreActionOutput; exports.DTODocumentationPageRoom = DTODocumentationPageRoom; exports.DTODocumentationPageRoomHeaderData = DTODocumentationPageRoomHeaderData; exports.DTODocumentationPageRoomHeaderDataUpdate = DTODocumentationPageRoomHeaderDataUpdate; exports.DTODocumentationPageRoomResponse = DTODocumentationPageRoomResponse; exports.DTODocumentationPageSnapshot = DTODocumentationPageSnapshot; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODocumentationPublishMetadata = DTODocumentationPublishMetadata; exports.DTODocumentationPublishTypeQueryParams = DTODocumentationPublishTypeQueryParams; exports.DTODocumentationStructure = DTODocumentationStructure; exports.DTODocumentationStructureGroupItem = DTODocumentationStructureGroupItem; exports.DTODocumentationStructureItem = DTODocumentationStructureItem; exports.DTODocumentationStructurePageItem = DTODocumentationStructurePageItem; exports.DTODocumentationTabCreateActionInputV2 = DTODocumentationTabCreateActionInputV2; exports.DTODocumentationTabCreateActionOutputV2 = DTODocumentationTabCreateActionOutputV2; exports.DTODocumentationTabGroupDeleteActionInputV2 = DTODocumentationTabGroupDeleteActionInputV2; exports.DTODocumentationTabGroupDeleteActionOutputV2 = DTODocumentationTabGroupDeleteActionOutputV2; exports.DTODownloadAssetsRequest = DTODownloadAssetsRequest; exports.DTODownloadAssetsResponse = DTODownloadAssetsResponse; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOElementPropertyDefinition = DTOElementPropertyDefinition; exports.DTOElementPropertyDefinitionCreatePayload = DTOElementPropertyDefinitionCreatePayload; exports.DTOElementPropertyDefinitionListResponse = DTOElementPropertyDefinitionListResponse; exports.DTOElementPropertyDefinitionOption = DTOElementPropertyDefinitionOption; exports.DTOElementPropertyDefinitionResponse = DTOElementPropertyDefinitionResponse; exports.DTOElementPropertyDefinitionUpdatePayload = DTOElementPropertyDefinitionUpdatePayload; exports.DTOElementPropertyValue = DTOElementPropertyValue; exports.DTOElementPropertyValueListResponse = DTOElementPropertyValueListResponse; exports.DTOElementPropertyValueResponse = DTOElementPropertyValueResponse; exports.DTOElementPropertyValueUpsertPaylod = DTOElementPropertyValueUpsertPaylod; exports.DTOElementView = DTOElementView; exports.DTOElementViewBasePropertyColumn = DTOElementViewBasePropertyColumn; exports.DTOElementViewColumn = DTOElementViewColumn; exports.DTOElementViewColumnSharedAttributes = DTOElementViewColumnSharedAttributes; exports.DTOElementViewPropertyDefinitionColumn = DTOElementViewPropertyDefinitionColumn; exports.DTOElementViewThemeColumn = DTOElementViewThemeColumn; exports.DTOElementViewsListResponse = DTOElementViewsListResponse; exports.DTOElementsGetOutput = DTOElementsGetOutput; exports.DTOElementsGetOutputV2 = DTOElementsGetOutputV2; exports.DTOElementsGetQuerySchema = DTOElementsGetQuerySchema; exports.DTOElementsGetTypeFilter = DTOElementsGetTypeFilter; exports.DTOEvent = DTOEvent; exports.DTOEventDataSourcesImported = DTOEventDataSourcesImported; exports.DTOEventFigmaNodesRendered = DTOEventFigmaNodesRendered; exports.DTOExportJob = DTOExportJob; exports.DTOExportJobCreatedBy = DTOExportJobCreatedBy; exports.DTOExportJobDesignSystemPreview = DTOExportJobDesignSystemPreview; exports.DTOExportJobDesignSystemVersionPreview = DTOExportJobDesignSystemVersionPreview; exports.DTOExportJobDestinations = DTOExportJobDestinations; exports.DTOExportJobResponse = DTOExportJobResponse; exports.DTOExportJobResponseLegacy = DTOExportJobResponseLegacy; exports.DTOExportJobResult = DTOExportJobResult; exports.DTOExportJobsListFilter = DTOExportJobsListFilter; exports.DTOExporter = DTOExporter; exports.DTOExporterCreateInput = DTOExporterCreateInput; exports.DTOExporterGitProviderEnum = DTOExporterGitProviderEnum; exports.DTOExporterListQuery = DTOExporterListQuery; exports.DTOExporterListResponse = DTOExporterListResponse; exports.DTOExporterMembership = DTOExporterMembership; exports.DTOExporterMembershipRole = DTOExporterMembershipRole; exports.DTOExporterPropertyDefinition = DTOExporterPropertyDefinition; exports.DTOExporterPropertyDefinitionArray = DTOExporterPropertyDefinitionArray; exports.DTOExporterPropertyDefinitionBoolean = DTOExporterPropertyDefinitionBoolean; exports.DTOExporterPropertyDefinitionEnum = DTOExporterPropertyDefinitionEnum; exports.DTOExporterPropertyDefinitionEnumOption = DTOExporterPropertyDefinitionEnumOption; exports.DTOExporterPropertyDefinitionNumber = DTOExporterPropertyDefinitionNumber; exports.DTOExporterPropertyDefinitionObject = DTOExporterPropertyDefinitionObject; exports.DTOExporterPropertyDefinitionString = DTOExporterPropertyDefinitionString; exports.DTOExporterPropertyDefinitionValue = DTOExporterPropertyDefinitionValue; exports.DTOExporterPropertyDefinitionValueMap = DTOExporterPropertyDefinitionValueMap; exports.DTOExporterPropertyDefinitionsResponse = DTOExporterPropertyDefinitionsResponse; exports.DTOExporterPropertyType = DTOExporterPropertyType; exports.DTOExporterResponse = DTOExporterResponse; exports.DTOExporterSource = DTOExporterSource; exports.DTOExporterType = DTOExporterType; exports.DTOExporterUpdateInput = DTOExporterUpdateInput; exports.DTOFigmaComponent = DTOFigmaComponent; exports.DTOFigmaComponentGroup = DTOFigmaComponentGroup; exports.DTOFigmaComponentGroupListResponse = DTOFigmaComponentGroupListResponse; exports.DTOFigmaComponentListResponse = DTOFigmaComponentListResponse; exports.DTOFigmaNode = DTOFigmaNode; exports.DTOFigmaNodeData = DTOFigmaNodeData; exports.DTOFigmaNodeDataV2 = DTOFigmaNodeDataV2; exports.DTOFigmaNodeOrigin = DTOFigmaNodeOrigin; exports.DTOFigmaNodeRenderActionInput = DTOFigmaNodeRenderActionInput; exports.DTOFigmaNodeRenderActionOutput = DTOFigmaNodeRenderActionOutput; exports.DTOFigmaNodeRenderAsyncActionInput = DTOFigmaNodeRenderAsyncActionInput; exports.DTOFigmaNodeRenderAsyncActionOutput = DTOFigmaNodeRenderAsyncActionOutput; exports.DTOFigmaNodeRenderFormat = DTOFigmaNodeRenderFormat; exports.DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderIdInput; exports.DTOFigmaNodeRenderInput = DTOFigmaNodeRenderInput; exports.DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderUrlInput; exports.DTOFigmaNodeRerenderInput = DTOFigmaNodeRerenderInput; exports.DTOFigmaNodeV2 = DTOFigmaNodeV2; exports.DTOFrameNodeStructure = DTOFrameNodeStructure; exports.DTOFrameNodeStructureListResponse = DTOFrameNodeStructureListResponse; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOGetDocumentationPageAnchorsResponse = DTOGetDocumentationPageAnchorsResponse; exports.DTOGitBranch = DTOGitBranch; exports.DTOGitOrganization = DTOGitOrganization; exports.DTOGitProject = DTOGitProject; exports.DTOGitRepository = DTOGitRepository; exports.DTOImportJob = DTOImportJob; exports.DTOImportJobResponse = DTOImportJobResponse; exports.DTOIntegration = DTOIntegration; exports.DTOIntegrationCredentials = DTOIntegrationCredentials; exports.DTOIntegrationOAuthGetResponse = DTOIntegrationOAuthGetResponse; exports.DTOIntegrationPostResponse = DTOIntegrationPostResponse; exports.DTOIntegrationsGetListResponse = DTOIntegrationsGetListResponse; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOLiveblocksAuthResponse = DTOLiveblocksAuthResponse; exports.DTOMoveDocumentationGroupInput = DTOMoveDocumentationGroupInput; exports.DTOMoveDocumentationPageInputV2 = DTOMoveDocumentationPageInputV2; exports.DTONpmRegistryConfig = DTONpmRegistryConfig; exports.DTONpmRegistryConfigConstants = DTONpmRegistryConfigConstants; exports.DTOObjectMeta = DTOObjectMeta; exports.DTOPageBlockColorV2 = DTOPageBlockColorV2; exports.DTOPageBlockDefinition = DTOPageBlockDefinition; exports.DTOPageBlockDefinitionBehavior = DTOPageBlockDefinitionBehavior; exports.DTOPageBlockDefinitionItem = DTOPageBlockDefinitionItem; exports.DTOPageBlockDefinitionLayout = DTOPageBlockDefinitionLayout; exports.DTOPageBlockDefinitionProperty = DTOPageBlockDefinitionProperty; exports.DTOPageBlockDefinitionVariant = DTOPageBlockDefinitionVariant; exports.DTOPageBlockItemV2 = DTOPageBlockItemV2; exports.DTOPageRedirect = DTOPageRedirect; exports.DTOPageRedirectCreateBody = DTOPageRedirectCreateBody; exports.DTOPageRedirectDeleteResponse = DTOPageRedirectDeleteResponse; exports.DTOPageRedirectListResponse = DTOPageRedirectListResponse; exports.DTOPageRedirectResponse = DTOPageRedirectResponse; exports.DTOPageRedirectUpdateBody = DTOPageRedirectUpdateBody; exports.DTOPagination = DTOPagination; exports.DTOPipeline = DTOPipeline; exports.DTOPipelineCreateBody = DTOPipelineCreateBody; exports.DTOPipelineListQuery = DTOPipelineListQuery; exports.DTOPipelineListResponse = DTOPipelineListResponse; exports.DTOPipelineResponse = DTOPipelineResponse; exports.DTOPipelineTriggerBody = DTOPipelineTriggerBody; exports.DTOPipelineUpdateBody = DTOPipelineUpdateBody; exports.DTOPublishDocumentationChanges = DTOPublishDocumentationChanges; exports.DTOPublishDocumentationRequest = DTOPublishDocumentationRequest; exports.DTOPublishDocumentationResponse = DTOPublishDocumentationResponse; exports.DTORenderedAssetFile = DTORenderedAssetFile; exports.DTORestoreDocumentationGroupInput = DTORestoreDocumentationGroupInput; exports.DTORestoreDocumentationPageInput = DTORestoreDocumentationPageInput; exports.DTOTheme = DTOTheme; exports.DTOThemeCreatePayload = DTOThemeCreatePayload; exports.DTOThemeListResponse = DTOThemeListResponse; exports.DTOThemeOverride = DTOThemeOverride; exports.DTOThemeOverrideCreatePayload = DTOThemeOverrideCreatePayload; exports.DTOThemeResponse = DTOThemeResponse; exports.DTOTokenCollection = DTOTokenCollection; exports.DTOTokenCollectionsListReponse = DTOTokenCollectionsListReponse; exports.DTOTransferOwnershipPayload = DTOTransferOwnershipPayload; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DTOUpdateUserNotificationSettingsPayload = DTOUpdateUserNotificationSettingsPayload; exports.DTOUpdateVersionInput = DTOUpdateVersionInput; exports.DTOUser = DTOUser; exports.DTOUserGetResponse = DTOUserGetResponse; exports.DTOUserNotificationSettingsResponse = DTOUserNotificationSettingsResponse; exports.DTOUserOnboarding = DTOUserOnboarding; exports.DTOUserOnboardingDepartment = DTOUserOnboardingDepartment; exports.DTOUserOnboardingJobLevel = DTOUserOnboardingJobLevel; exports.DTOUserProfile = DTOUserProfile; exports.DTOUserProfileUpdate = DTOUserProfileUpdate; exports.DTOUserProfileUpdatePayload = DTOUserProfileUpdatePayload; exports.DTOUserProfileUpdateResponse = DTOUserProfileUpdateResponse; exports.DTOUserSource = DTOUserSource; exports.DTOUserTheme = DTOUserTheme; exports.DTOUserWorkspaceMembership = DTOUserWorkspaceMembership; exports.DTOUserWorkspaceMembershipsResponse = DTOUserWorkspaceMembershipsResponse; exports.DTOWorkspace = DTOWorkspace; exports.DTOWorkspaceCreateInput = DTOWorkspaceCreateInput; exports.DTOWorkspaceIntegrationGetGitObjectsInput = DTOWorkspaceIntegrationGetGitObjectsInput; exports.DTOWorkspaceIntegrationOauthInput = DTOWorkspaceIntegrationOauthInput; exports.DTOWorkspaceIntegrationPATInput = DTOWorkspaceIntegrationPATInput; exports.DTOWorkspaceInvitationInput = DTOWorkspaceInvitationInput; exports.DTOWorkspaceInvitationUpdateResponse = DTOWorkspaceInvitationUpdateResponse; exports.DTOWorkspaceInvitationsListInput = DTOWorkspaceInvitationsListInput; exports.DTOWorkspaceInvitationsResponse = DTOWorkspaceInvitationsResponse; exports.DTOWorkspaceInviteUpdate = DTOWorkspaceInviteUpdate; exports.DTOWorkspaceMember = DTOWorkspaceMember; exports.DTOWorkspaceMembersListResponse = DTOWorkspaceMembersListResponse; exports.DTOWorkspaceProfile = DTOWorkspaceProfile; exports.DTOWorkspaceResponse = DTOWorkspaceResponse; exports.DTOWorkspaceRole = DTOWorkspaceRole; exports.DesignSystemBffEndpoint = DesignSystemBffEndpoint; exports.DesignSystemComponentEndpoint = DesignSystemComponentEndpoint; exports.DesignSystemContactsEndpoint = DesignSystemContactsEndpoint; exports.DesignSystemMembersEndpoint = DesignSystemMembersEndpoint; exports.DesignSystemSourcesEndpoint = DesignSystemSourcesEndpoint; exports.DesignSystemVersionsEndpoint = DesignSystemVersionsEndpoint; exports.DesignSystemsEndpoint = DesignSystemsEndpoint; exports.DimensionsVariableScopeType = DimensionsVariableScopeType; exports.DocumentationEndpoint = DocumentationEndpoint; exports.DocumentationHierarchySettings = DocumentationHierarchySettings; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.ElementPropertyDefinitionsEndpoint = ElementPropertyDefinitionsEndpoint; exports.ElementPropertyValuesEndpoint = ElementPropertyValuesEndpoint; exports.ElementsActionEndpoint = ElementsActionEndpoint; exports.ElementsEndpoint = ElementsEndpoint; exports.ExporterJobsEndpoint = ExporterJobsEndpoint; exports.ExportersEndpoint = ExportersEndpoint; exports.FigmaComponentGroupsEndpoint = FigmaComponentGroupsEndpoint; exports.FigmaComponentsEndpoint = FigmaComponentsEndpoint; exports.FigmaFrameStructuresEndpoint = FigmaFrameStructuresEndpoint; exports.FigmaUtils = FigmaUtils; exports.FormattedCollections = FormattedCollections; exports.FrontendVersionRoomYDoc = FrontendVersionRoomYDoc; exports.ImportJobsEndpoint = ImportJobsEndpoint; exports.ListTreeBuilder = ListTreeBuilder; exports.LiveblocksEndpoint = LiveblocksEndpoint; exports.NpmRegistryInput = NpmRegistryInput; exports.ObjectMeta = ObjectMeta2; exports.OverridesEndpoint = OverridesEndpoint; exports.PageBlockEditorModel = PageBlockEditorModel; exports.PageSectionEditorModel = PageSectionEditorModel; exports.ParsedFigmaFileURLError = ParsedFigmaFileURLError; exports.PipelinesEndpoint = PipelinesEndpoint; exports.RGB = RGB; exports.RGBA = RGBA; exports.RequestExecutor = RequestExecutor; exports.RequestExecutorError = RequestExecutorError; exports.ResolvedVariableType = ResolvedVariableType; exports.StringVariableScopeType = StringVariableScopeType; exports.SupernovaApiClient = SupernovaApiClient; exports.ThemesEndpoint = ThemesEndpoint; exports.TokenCollectionsEndpoint = TokenCollectionsEndpoint; exports.TokenGroupsEndpoint = TokenGroupsEndpoint; exports.TokensEndpoint = TokensEndpoint; exports.UsersEndpoint = UsersEndpoint; exports.Variable = Variable; exports.VariableAlias = VariableAlias; exports.VariableMode = VariableMode; exports.VariableValue = VariableValue; exports.VariablesMapping = VariablesMapping; exports.VersionRoomBaseYDoc = VersionRoomBaseYDoc; exports.VersionSQSPayload = VersionSQSPayload; exports.VersionStatsEndpoint = VersionStatsEndpoint; exports.WorkspaceConfigurationPayload = WorkspaceConfigurationPayload; exports.WorkspaceInvitationsEndpoint = WorkspaceInvitationsEndpoint; exports.WorkspaceMembersEndpoint = WorkspaceMembersEndpoint; exports.WorkspacesEndpoint = WorkspacesEndpoint; exports.applyPrivacyConfigurationToNestedItems = applyPrivacyConfigurationToNestedItems; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.documentationItemConfigurationToDTOV1 = documentationItemConfigurationToDTOV1; exports.documentationItemConfigurationToDTOV2 = documentationItemConfigurationToDTOV2; exports.documentationPageToDTOV2 = documentationPageToDTOV2; exports.documentationPagesFixedConfigurationToDTOV1 = documentationPagesFixedConfigurationToDTOV1; exports.documentationPagesFixedConfigurationToDTOV2 = documentationPagesFixedConfigurationToDTOV2; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.elementGroupsToDocumentationGroupDTOV1 = elementGroupsToDocumentationGroupDTOV1; exports.elementGroupsToDocumentationGroupDTOV2 = elementGroupsToDocumentationGroupDTOV2; exports.elementGroupsToDocumentationGroupFixedConfigurationDTOV1 = elementGroupsToDocumentationGroupFixedConfigurationDTOV1; exports.elementGroupsToDocumentationGroupFixedConfigurationDTOV2 = elementGroupsToDocumentationGroupFixedConfigurationDTOV2; exports.elementGroupsToDocumentationGroupStructureDTOV1 = elementGroupsToDocumentationGroupStructureDTOV1; exports.generateHash = generateHash; exports.generatePageContentHash = generatePageContentHash; exports.getDtoDefaultItemConfigurationV1 = getDtoDefaultItemConfigurationV1; exports.getDtoDefaultItemConfigurationV2 = getDtoDefaultItemConfigurationV2; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.gitBranchToDto = gitBranchToDto; exports.gitOrganizationToDto = gitOrganizationToDto; exports.gitProjectToDto = gitProjectToDto; exports.gitRepositoryToDto = gitRepositoryToDto; exports.innerEditorProsemirrorSchema = innerEditorProsemirrorSchema; exports.integrationCredentialToDto = integrationCredentialToDto; exports.integrationToDto = integrationToDto; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.mainEditorProsemirrorSchema = mainEditorProsemirrorSchema; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYDoc = pageToYDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pipelineToDto = pipelineToDto; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorDocToRichTextPropertyValue = prosemirrorDocToRichTextPropertyValue; exports.prosemirrorNodeToSection = prosemirrorNodeToSection; exports.prosemirrorNodesToBlocks = prosemirrorNodesToBlocks; exports.richTextPropertyValueToProsemirror = richTextPropertyValueToProsemirror; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.serializeQuery = serializeQuery; exports.shallowProsemirrorNodeToBlock = shallowProsemirrorNodeToBlock; exports.validateDesignSystemVersion = validateDesignSystemVersion; exports.validateSsoPayload = validateSsoPayload; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
14222
+ exports.BackendVersionRoomYDoc = BackendVersionRoomYDoc; exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.BrandsEndpoint = BrandsEndpoint; exports.CodegenEndpoint = CodegenEndpoint; exports.Collection = Collection2; exports.DTOAppBootstrapDataQuery = DTOAppBootstrapDataQuery; exports.DTOAppBootstrapDataResponse = DTOAppBootstrapDataResponse; exports.DTOAssetRenderConfiguration = DTOAssetRenderConfiguration; exports.DTOAuthenticatedUser = DTOAuthenticatedUser; exports.DTOAuthenticatedUserProfile = DTOAuthenticatedUserProfile; exports.DTOAuthenticatedUserResponse = DTOAuthenticatedUserResponse; exports.DTOBffFigmaImportRequestBody = DTOBffFigmaImportRequestBody; exports.DTOBffImportRequestBody = DTOBffImportRequestBody; exports.DTOBffUploadImportRequestBody = DTOBffUploadImportRequestBody; exports.DTOBrand = DTOBrand; exports.DTOBrandCreatePayload = DTOBrandCreatePayload; exports.DTOBrandCreateResponse = DTOBrandCreateResponse; exports.DTOBrandGetResponse = DTOBrandGetResponse; exports.DTOBrandUpdatePayload = DTOBrandUpdatePayload; exports.DTOBrandsListResponse = DTOBrandsListResponse; exports.DTOColorTokenInlineData = DTOColorTokenInlineData; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTOCreateDocumentationTabInput = DTOCreateDocumentationTabInput; exports.DTOCreateVersionInput = DTOCreateVersionInput; exports.DTODataSource = DTODataSource; exports.DTODataSourceFigma = DTODataSourceFigma; exports.DTODataSourceFigmaCloud = DTODataSourceFigmaCloud; exports.DTODataSourceFigmaCreatePayload = DTODataSourceFigmaCreatePayload; exports.DTODataSourceFigmaImportPayload = DTODataSourceFigmaImportPayload; exports.DTODataSourceFigmaScope = DTODataSourceFigmaScope; exports.DTODataSourceFigmaVariablesPlugin = DTODataSourceFigmaVariablesPlugin; exports.DTODataSourceResponse = DTODataSourceResponse; exports.DTODataSourceTokenStudio = DTODataSourceTokenStudio; exports.DTODataSourcesListResponse = DTODataSourcesListResponse; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODeleteDocumentationTabGroupInput = DTODeleteDocumentationTabGroupInput; exports.DTODesignElementsDataDiffResponse = DTODesignElementsDataDiffResponse; exports.DTODesignSystem = DTODesignSystem; exports.DTODesignSystemComponent = DTODesignSystemComponent; exports.DTODesignSystemComponentCreateInput = DTODesignSystemComponentCreateInput; exports.DTODesignSystemComponentListResponse = DTODesignSystemComponentListResponse; exports.DTODesignSystemComponentResponse = DTODesignSystemComponentResponse; exports.DTODesignSystemContactsResponse = DTODesignSystemContactsResponse; exports.DTODesignSystemCreateInput = DTODesignSystemCreateInput; exports.DTODesignSystemInvitation = DTODesignSystemInvitation; exports.DTODesignSystemMember = DTODesignSystemMember; exports.DTODesignSystemMemberListResponse = DTODesignSystemMemberListResponse; exports.DTODesignSystemMembersUpdatePayload = DTODesignSystemMembersUpdatePayload; exports.DTODesignSystemMembersUpdateResponse = DTODesignSystemMembersUpdateResponse; exports.DTODesignSystemResponse = DTODesignSystemResponse; exports.DTODesignSystemRole = DTODesignSystemRole; exports.DTODesignSystemUpdateAccessModeInput = DTODesignSystemUpdateAccessModeInput; exports.DTODesignSystemUpdateInput = DTODesignSystemUpdateInput; exports.DTODesignSystemVersion = DTODesignSystemVersion; exports.DTODesignSystemVersionCreationResponse = DTODesignSystemVersionCreationResponse; exports.DTODesignSystemVersionGetResponse = DTODesignSystemVersionGetResponse; exports.DTODesignSystemVersionJobStatusResponse = DTODesignSystemVersionJobStatusResponse; exports.DTODesignSystemVersionJobsResponse = DTODesignSystemVersionJobsResponse; exports.DTODesignSystemVersionStats = DTODesignSystemVersionStats; exports.DTODesignSystemVersionStatsQuery = DTODesignSystemVersionStatsQuery; exports.DTODesignSystemVersionsListResponse = DTODesignSystemVersionsListResponse; exports.DTODesignSystemsListResponse = DTODesignSystemsListResponse; exports.DTODesignToken = DTODesignToken; exports.DTODesignTokenCreatePayload = DTODesignTokenCreatePayload; exports.DTODesignTokenGroup = DTODesignTokenGroup; exports.DTODesignTokenGroupCreatePayload = DTODesignTokenGroupCreatePayload; exports.DTODesignTokenGroupListResponse = DTODesignTokenGroupListResponse; exports.DTODesignTokenGroupResponse = DTODesignTokenGroupResponse; exports.DTODesignTokenListResponse = DTODesignTokenListResponse; exports.DTODesignTokenResponse = DTODesignTokenResponse; exports.DTODiffCountBase = DTODiffCountBase; exports.DTODocumentationDraftChangeType = DTODocumentationDraftChangeType; exports.DTODocumentationDraftState = DTODocumentationDraftState; exports.DTODocumentationDraftStateCreated = DTODocumentationDraftStateCreated; exports.DTODocumentationDraftStateDeleted = DTODocumentationDraftStateDeleted; exports.DTODocumentationDraftStateUpdated = DTODocumentationDraftStateUpdated; exports.DTODocumentationGroupApprovalState = DTODocumentationGroupApprovalState; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupMoveActionInputV2 = DTODocumentationGroupMoveActionInputV2; exports.DTODocumentationGroupMoveActionOutputV2 = DTODocumentationGroupMoveActionOutputV2; exports.DTODocumentationGroupRestoreActionInput = DTODocumentationGroupRestoreActionInput; exports.DTODocumentationGroupRestoreActionOutput = DTODocumentationGroupRestoreActionOutput; exports.DTODocumentationGroupStructureV1 = DTODocumentationGroupStructureV1; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationGroupV1 = DTODocumentationGroupV1; exports.DTODocumentationGroupV2 = DTODocumentationGroupV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationItemConfigurationV1 = DTODocumentationItemConfigurationV1; exports.DTODocumentationItemConfigurationV2 = DTODocumentationItemConfigurationV2; exports.DTODocumentationItemHeaderV2 = DTODocumentationItemHeaderV2; exports.DTODocumentationLinkPreviewRequest = DTODocumentationLinkPreviewRequest; exports.DTODocumentationLinkPreviewResponse = DTODocumentationLinkPreviewResponse; exports.DTODocumentationPageAnchor = DTODocumentationPageAnchor; exports.DTODocumentationPageApprovalState = DTODocumentationPageApprovalState; exports.DTODocumentationPageApprovalStateChangeActionInput = DTODocumentationPageApprovalStateChangeActionInput; exports.DTODocumentationPageApprovalStateChangeActionOutput = DTODocumentationPageApprovalStateChangeActionOutput; exports.DTODocumentationPageApprovalStateChangeInput = DTODocumentationPageApprovalStateChangeInput; exports.DTODocumentationPageContent = DTODocumentationPageContent; exports.DTODocumentationPageContentGetResponse = DTODocumentationPageContentGetResponse; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; exports.DTODocumentationPageMoveActionInputV2 = DTODocumentationPageMoveActionInputV2; exports.DTODocumentationPageMoveActionOutputV2 = DTODocumentationPageMoveActionOutputV2; exports.DTODocumentationPageRestoreActionInput = DTODocumentationPageRestoreActionInput; exports.DTODocumentationPageRestoreActionOutput = DTODocumentationPageRestoreActionOutput; exports.DTODocumentationPageRoom = DTODocumentationPageRoom; exports.DTODocumentationPageRoomHeaderData = DTODocumentationPageRoomHeaderData; exports.DTODocumentationPageRoomHeaderDataUpdate = DTODocumentationPageRoomHeaderDataUpdate; exports.DTODocumentationPageRoomResponse = DTODocumentationPageRoomResponse; exports.DTODocumentationPageSnapshot = DTODocumentationPageSnapshot; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODocumentationPublishMetadata = DTODocumentationPublishMetadata; exports.DTODocumentationPublishTypeQueryParams = DTODocumentationPublishTypeQueryParams; exports.DTODocumentationStructure = DTODocumentationStructure; exports.DTODocumentationStructureGroupItem = DTODocumentationStructureGroupItem; exports.DTODocumentationStructureItem = DTODocumentationStructureItem; exports.DTODocumentationStructurePageItem = DTODocumentationStructurePageItem; exports.DTODocumentationTabCreateActionInputV2 = DTODocumentationTabCreateActionInputV2; exports.DTODocumentationTabCreateActionOutputV2 = DTODocumentationTabCreateActionOutputV2; exports.DTODocumentationTabGroupDeleteActionInputV2 = DTODocumentationTabGroupDeleteActionInputV2; exports.DTODocumentationTabGroupDeleteActionOutputV2 = DTODocumentationTabGroupDeleteActionOutputV2; exports.DTODownloadAssetsRequest = DTODownloadAssetsRequest; exports.DTODownloadAssetsResponse = DTODownloadAssetsResponse; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOElementPropertyDefinition = DTOElementPropertyDefinition; exports.DTOElementPropertyDefinitionCreatePayload = DTOElementPropertyDefinitionCreatePayload; exports.DTOElementPropertyDefinitionListResponse = DTOElementPropertyDefinitionListResponse; exports.DTOElementPropertyDefinitionOption = DTOElementPropertyDefinitionOption; exports.DTOElementPropertyDefinitionResponse = DTOElementPropertyDefinitionResponse; exports.DTOElementPropertyDefinitionUpdatePayload = DTOElementPropertyDefinitionUpdatePayload; exports.DTOElementPropertyValue = DTOElementPropertyValue; exports.DTOElementPropertyValueListResponse = DTOElementPropertyValueListResponse; exports.DTOElementPropertyValueResponse = DTOElementPropertyValueResponse; exports.DTOElementPropertyValueUpsertPaylod = DTOElementPropertyValueUpsertPaylod; exports.DTOElementView = DTOElementView; exports.DTOElementViewBasePropertyColumn = DTOElementViewBasePropertyColumn; exports.DTOElementViewColumn = DTOElementViewColumn; exports.DTOElementViewColumnSharedAttributes = DTOElementViewColumnSharedAttributes; exports.DTOElementViewPropertyDefinitionColumn = DTOElementViewPropertyDefinitionColumn; exports.DTOElementViewThemeColumn = DTOElementViewThemeColumn; exports.DTOElementViewsListResponse = DTOElementViewsListResponse; exports.DTOElementsGetOutput = DTOElementsGetOutput; exports.DTOElementsGetOutputV2 = DTOElementsGetOutputV2; exports.DTOElementsGetQuerySchema = DTOElementsGetQuerySchema; exports.DTOElementsGetTypeFilter = DTOElementsGetTypeFilter; exports.DTOExportJob = DTOExportJob; exports.DTOExportJobCreatedBy = DTOExportJobCreatedBy; exports.DTOExportJobDesignSystemPreview = DTOExportJobDesignSystemPreview; exports.DTOExportJobDesignSystemVersionPreview = DTOExportJobDesignSystemVersionPreview; exports.DTOExportJobDestinations = DTOExportJobDestinations; exports.DTOExportJobResponse = DTOExportJobResponse; exports.DTOExportJobResponseLegacy = DTOExportJobResponseLegacy; exports.DTOExportJobResult = DTOExportJobResult; exports.DTOExportJobsListFilter = DTOExportJobsListFilter; exports.DTOExporter = DTOExporter; exports.DTOExporterCreateInput = DTOExporterCreateInput; exports.DTOExporterGitProviderEnum = DTOExporterGitProviderEnum; exports.DTOExporterListQuery = DTOExporterListQuery; exports.DTOExporterListResponse = DTOExporterListResponse; exports.DTOExporterMembership = DTOExporterMembership; exports.DTOExporterMembershipRole = DTOExporterMembershipRole; exports.DTOExporterPropertyDefinition = DTOExporterPropertyDefinition; exports.DTOExporterPropertyDefinitionArray = DTOExporterPropertyDefinitionArray; exports.DTOExporterPropertyDefinitionBoolean = DTOExporterPropertyDefinitionBoolean; exports.DTOExporterPropertyDefinitionEnum = DTOExporterPropertyDefinitionEnum; exports.DTOExporterPropertyDefinitionEnumOption = DTOExporterPropertyDefinitionEnumOption; exports.DTOExporterPropertyDefinitionNumber = DTOExporterPropertyDefinitionNumber; exports.DTOExporterPropertyDefinitionObject = DTOExporterPropertyDefinitionObject; exports.DTOExporterPropertyDefinitionString = DTOExporterPropertyDefinitionString; exports.DTOExporterPropertyDefinitionValue = DTOExporterPropertyDefinitionValue; exports.DTOExporterPropertyDefinitionValueMap = DTOExporterPropertyDefinitionValueMap; exports.DTOExporterPropertyDefinitionsResponse = DTOExporterPropertyDefinitionsResponse; exports.DTOExporterPropertyType = DTOExporterPropertyType; exports.DTOExporterResponse = DTOExporterResponse; exports.DTOExporterSource = DTOExporterSource; exports.DTOExporterType = DTOExporterType; exports.DTOExporterUpdateInput = DTOExporterUpdateInput; exports.DTOFigmaComponent = DTOFigmaComponent; exports.DTOFigmaComponentGroup = DTOFigmaComponentGroup; exports.DTOFigmaComponentGroupListResponse = DTOFigmaComponentGroupListResponse; exports.DTOFigmaComponentListResponse = DTOFigmaComponentListResponse; exports.DTOFigmaNode = DTOFigmaNode; exports.DTOFigmaNodeData = DTOFigmaNodeData; exports.DTOFigmaNodeDataV2 = DTOFigmaNodeDataV2; exports.DTOFigmaNodeOrigin = DTOFigmaNodeOrigin; exports.DTOFigmaNodeRenderActionInput = DTOFigmaNodeRenderActionInput; exports.DTOFigmaNodeRenderActionOutput = DTOFigmaNodeRenderActionOutput; exports.DTOFigmaNodeRenderAsyncActionInput = DTOFigmaNodeRenderAsyncActionInput; exports.DTOFigmaNodeRenderAsyncActionOutput = DTOFigmaNodeRenderAsyncActionOutput; exports.DTOFigmaNodeRenderFormat = DTOFigmaNodeRenderFormat; exports.DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderIdInput; exports.DTOFigmaNodeRenderInput = DTOFigmaNodeRenderInput; exports.DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderUrlInput; exports.DTOFigmaNodeRerenderInput = DTOFigmaNodeRerenderInput; exports.DTOFigmaNodeV2 = DTOFigmaNodeV2; exports.DTOFrameNodeStructure = DTOFrameNodeStructure; exports.DTOFrameNodeStructureListResponse = DTOFrameNodeStructureListResponse; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOGetDocumentationPageAnchorsResponse = DTOGetDocumentationPageAnchorsResponse; exports.DTOGitBranch = DTOGitBranch; exports.DTOGitOrganization = DTOGitOrganization; exports.DTOGitProject = DTOGitProject; exports.DTOGitRepository = DTOGitRepository; exports.DTOImportJob = DTOImportJob; exports.DTOImportJobResponse = DTOImportJobResponse; exports.DTOIntegration = DTOIntegration; exports.DTOIntegrationCredentials = DTOIntegrationCredentials; exports.DTOIntegrationOAuthGetResponse = DTOIntegrationOAuthGetResponse; exports.DTOIntegrationPostResponse = DTOIntegrationPostResponse; exports.DTOIntegrationsGetListResponse = DTOIntegrationsGetListResponse; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOLiveblocksAuthResponse = DTOLiveblocksAuthResponse; exports.DTOMoveDocumentationGroupInput = DTOMoveDocumentationGroupInput; exports.DTOMoveDocumentationPageInputV2 = DTOMoveDocumentationPageInputV2; exports.DTONpmRegistryConfig = DTONpmRegistryConfig; exports.DTONpmRegistryConfigConstants = DTONpmRegistryConfigConstants; exports.DTOObjectMeta = DTOObjectMeta; exports.DTOPageBlockColorV2 = DTOPageBlockColorV2; exports.DTOPageBlockDefinition = DTOPageBlockDefinition; exports.DTOPageBlockDefinitionBehavior = DTOPageBlockDefinitionBehavior; exports.DTOPageBlockDefinitionItem = DTOPageBlockDefinitionItem; exports.DTOPageBlockDefinitionLayout = DTOPageBlockDefinitionLayout; exports.DTOPageBlockDefinitionProperty = DTOPageBlockDefinitionProperty; exports.DTOPageBlockDefinitionVariant = DTOPageBlockDefinitionVariant; exports.DTOPageBlockItemV2 = DTOPageBlockItemV2; exports.DTOPagination = DTOPagination; exports.DTOPipeline = DTOPipeline; exports.DTOPipelineCreateBody = DTOPipelineCreateBody; exports.DTOPipelineListQuery = DTOPipelineListQuery; exports.DTOPipelineListResponse = DTOPipelineListResponse; exports.DTOPipelineResponse = DTOPipelineResponse; exports.DTOPipelineTriggerBody = DTOPipelineTriggerBody; exports.DTOPipelineUpdateBody = DTOPipelineUpdateBody; exports.DTOPublishDocumentationChanges = DTOPublishDocumentationChanges; exports.DTOPublishDocumentationRequest = DTOPublishDocumentationRequest; exports.DTOPublishDocumentationResponse = DTOPublishDocumentationResponse; exports.DTORenderedAssetFile = DTORenderedAssetFile; exports.DTORestoreDocumentationGroupInput = DTORestoreDocumentationGroupInput; exports.DTORestoreDocumentationPageInput = DTORestoreDocumentationPageInput; exports.DTOTheme = DTOTheme; exports.DTOThemeCreatePayload = DTOThemeCreatePayload; exports.DTOThemeListResponse = DTOThemeListResponse; exports.DTOThemeOverride = DTOThemeOverride; exports.DTOThemeOverrideCreatePayload = DTOThemeOverrideCreatePayload; exports.DTOThemeResponse = DTOThemeResponse; exports.DTOTokenCollection = DTOTokenCollection; exports.DTOTokenCollectionsListReponse = DTOTokenCollectionsListReponse; exports.DTOTransferOwnershipPayload = DTOTransferOwnershipPayload; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DTOUpdateUserNotificationSettingsPayload = DTOUpdateUserNotificationSettingsPayload; exports.DTOUpdateVersionInput = DTOUpdateVersionInput; exports.DTOUser = DTOUser; exports.DTOUserGetResponse = DTOUserGetResponse; exports.DTOUserNotificationSettingsResponse = DTOUserNotificationSettingsResponse; exports.DTOUserOnboarding = DTOUserOnboarding; exports.DTOUserOnboardingDepartment = DTOUserOnboardingDepartment; exports.DTOUserOnboardingJobLevel = DTOUserOnboardingJobLevel; exports.DTOUserProfile = DTOUserProfile; exports.DTOUserProfileUpdate = DTOUserProfileUpdate; exports.DTOUserProfileUpdatePayload = DTOUserProfileUpdatePayload; exports.DTOUserProfileUpdateResponse = DTOUserProfileUpdateResponse; exports.DTOUserSource = DTOUserSource; exports.DTOUserWorkspaceMembership = DTOUserWorkspaceMembership; exports.DTOUserWorkspaceMembershipsResponse = DTOUserWorkspaceMembershipsResponse; exports.DTOWorkspace = DTOWorkspace; exports.DTOWorkspaceCreateInput = DTOWorkspaceCreateInput; exports.DTOWorkspaceIntegrationGetGitObjectsInput = DTOWorkspaceIntegrationGetGitObjectsInput; exports.DTOWorkspaceIntegrationOauthInput = DTOWorkspaceIntegrationOauthInput; exports.DTOWorkspaceIntegrationPATInput = DTOWorkspaceIntegrationPATInput; exports.DTOWorkspaceInvitationInput = DTOWorkspaceInvitationInput; exports.DTOWorkspaceInvitationUpdateResponse = DTOWorkspaceInvitationUpdateResponse; exports.DTOWorkspaceInvitationsListInput = DTOWorkspaceInvitationsListInput; exports.DTOWorkspaceInvitationsResponse = DTOWorkspaceInvitationsResponse; exports.DTOWorkspaceInviteUpdate = DTOWorkspaceInviteUpdate; exports.DTOWorkspaceMember = DTOWorkspaceMember; exports.DTOWorkspaceMembersListResponse = DTOWorkspaceMembersListResponse; exports.DTOWorkspaceProfile = DTOWorkspaceProfile; exports.DTOWorkspaceResponse = DTOWorkspaceResponse; exports.DTOWorkspaceRole = DTOWorkspaceRole; exports.DesignSystemBffEndpoint = DesignSystemBffEndpoint; exports.DesignSystemComponentEndpoint = DesignSystemComponentEndpoint; exports.DesignSystemContactsEndpoint = DesignSystemContactsEndpoint; exports.DesignSystemMembersEndpoint = DesignSystemMembersEndpoint; exports.DesignSystemSourcesEndpoint = DesignSystemSourcesEndpoint; exports.DesignSystemVersionsEndpoint = DesignSystemVersionsEndpoint; exports.DesignSystemsEndpoint = DesignSystemsEndpoint; exports.DimensionsVariableScopeType = DimensionsVariableScopeType; exports.DocsStructureRepository = DocsStructureRepository; exports.DocsStructureRepositoryV2 = DocsStructureRepositoryV2; exports.DocumentationEndpoint = DocumentationEndpoint; exports.DocumentationHierarchySettings = DocumentationHierarchySettings; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.ElementPropertyDefinitionsEndpoint = ElementPropertyDefinitionsEndpoint; exports.ElementPropertyValuesEndpoint = ElementPropertyValuesEndpoint; exports.ElementsActionEndpoint = ElementsActionEndpoint; exports.ElementsEndpoint = ElementsEndpoint; exports.ExporterJobsEndpoint = ExporterJobsEndpoint; exports.ExportersEndpoint = ExportersEndpoint; exports.FigmaComponentGroupsEndpoint = FigmaComponentGroupsEndpoint; exports.FigmaComponentsEndpoint = FigmaComponentsEndpoint; exports.FigmaFrameStructuresEndpoint = FigmaFrameStructuresEndpoint; exports.FigmaUtils = FigmaUtils; exports.FormattedCollections = FormattedCollections; exports.FrontendVersionRoomYDoc = FrontendVersionRoomYDoc; exports.ImportJobsEndpoint = ImportJobsEndpoint; exports.ListTreeBuilder = ListTreeBuilder; exports.LiveblocksEndpoint = LiveblocksEndpoint; exports.LocalStorage = LocalStorage; exports.NpmRegistryInput = NpmRegistryInput; exports.ObjectMeta = ObjectMeta2; exports.OverridesEndpoint = OverridesEndpoint; exports.PageBlockEditorModel = PageBlockEditorModel; exports.PageSectionEditorModel = PageSectionEditorModel; exports.ParsedFigmaFileURLError = ParsedFigmaFileURLError; exports.PipelinesEndpoint = PipelinesEndpoint; exports.RGB = RGB; exports.RGBA = RGBA; exports.RequestExecutor = RequestExecutor; exports.RequestExecutorError = RequestExecutorError; exports.ResolvedVariableType = ResolvedVariableType; exports.StringVariableScopeType = StringVariableScopeType; exports.SupernovaApiClient = SupernovaApiClient; exports.ThemesEndpoint = ThemesEndpoint; exports.TokenCollectionsEndpoint = TokenCollectionsEndpoint; exports.TokenGroupsEndpoint = TokenGroupsEndpoint; exports.TokensEndpoint = TokensEndpoint; exports.UsersEndpoint = UsersEndpoint; exports.Variable = Variable; exports.VariableAlias = VariableAlias; exports.VariableMode = VariableMode; exports.VariableValue = VariableValue; exports.VariablesMapping = VariablesMapping; exports.VersionRoomBaseYDoc = VersionRoomBaseYDoc; exports.VersionSQSPayload = VersionSQSPayload; exports.VersionStatsEndpoint = VersionStatsEndpoint; exports.WorkspaceConfigurationPayload = WorkspaceConfigurationPayload; exports.WorkspaceInvitationsEndpoint = WorkspaceInvitationsEndpoint; exports.WorkspaceMembersEndpoint = WorkspaceMembersEndpoint; exports.WorkspacesEndpoint = WorkspacesEndpoint; exports.applyPrivacyConfigurationToNestedItems = applyPrivacyConfigurationToNestedItems; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.computeDocsHierarchy = computeDocsHierarchy; exports.documentationItemConfigurationToDTOV1 = documentationItemConfigurationToDTOV1; exports.documentationItemConfigurationToDTOV2 = documentationItemConfigurationToDTOV2; exports.documentationPageToDTOV2 = documentationPageToDTOV2; exports.documentationPagesFixedConfigurationToDTOV1 = documentationPagesFixedConfigurationToDTOV1; exports.documentationPagesFixedConfigurationToDTOV2 = documentationPagesFixedConfigurationToDTOV2; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.elementGroupsToDocumentationGroupDTOV1 = elementGroupsToDocumentationGroupDTOV1; exports.elementGroupsToDocumentationGroupDTOV2 = elementGroupsToDocumentationGroupDTOV2; exports.elementGroupsToDocumentationGroupFixedConfigurationDTOV1 = elementGroupsToDocumentationGroupFixedConfigurationDTOV1; exports.elementGroupsToDocumentationGroupFixedConfigurationDTOV2 = elementGroupsToDocumentationGroupFixedConfigurationDTOV2; exports.elementGroupsToDocumentationGroupStructureDTOV1 = elementGroupsToDocumentationGroupStructureDTOV1; exports.generateHash = generateHash; exports.generatePageContentHash = generatePageContentHash; exports.getDtoDefaultItemConfigurationV1 = getDtoDefaultItemConfigurationV1; exports.getDtoDefaultItemConfigurationV2 = getDtoDefaultItemConfigurationV2; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.gitBranchToDto = gitBranchToDto; exports.gitOrganizationToDto = gitOrganizationToDto; exports.gitProjectToDto = gitProjectToDto; exports.gitRepositoryToDto = gitRepositoryToDto; exports.innerEditorProsemirrorSchema = innerEditorProsemirrorSchema; exports.integrationCredentialToDto = integrationCredentialToDto; exports.integrationToDto = integrationToDto; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.mainEditorProsemirrorSchema = mainEditorProsemirrorSchema; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYDoc = pageToYDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pipelineToDto = pipelineToDto; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorDocToRichTextPropertyValue = prosemirrorDocToRichTextPropertyValue; exports.prosemirrorNodeToSection = prosemirrorNodeToSection; exports.prosemirrorNodesToBlocks = prosemirrorNodesToBlocks; exports.richTextPropertyValueToProsemirror = richTextPropertyValueToProsemirror; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.serializeQuery = serializeQuery; exports.shallowProsemirrorNodeToBlock = shallowProsemirrorNodeToBlock; exports.validateDesignSystemVersion = validateDesignSystemVersion; exports.validateSsoPayload = validateSsoPayload; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
13750
14223
  //# sourceMappingURL=index.js.map