@supernova-studio/client 1.0.0-alpha.16 → 1.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -6940,7 +6940,9 @@ var DTODocumentationHierarchyV2 = z241.object({
6940
6940
  /** Defined when a page has changed since last publish and can be included into a partial publish */
6941
6941
  draftState: DTODocumentationDraftState.optional()
6942
6942
  })
6943
- )
6943
+ ),
6944
+ /** True if the documentation was already published, false otherwise. */
6945
+ hasPublishedDocumentationContent: z241.boolean()
6944
6946
  });
6945
6947
 
6946
6948
  // src/api/dto/elements/documentation/page-actions-v2.ts
@@ -7034,49 +7036,57 @@ var DocumentationPageV1DTO = DocumentationPageV1.omit({
7034
7036
  path: z244.string()
7035
7037
  });
7036
7038
 
7037
- // src/api/dto/elements/documentation/structure.ts
7039
+ // src/api/dto/elements/documentation/settings.ts
7038
7040
  import { z as z245 } from "zod";
7039
- var DTODocumentationStructureItemType = z245.enum(["Group", "Page"]);
7040
- var DTODocumentationStructureItemBase = z245.object({
7041
+ var DTODocumentationSettings = z245.object({
7042
+ isDraftFeatureAdopted: z245.boolean(),
7043
+ isApprovalsFeatureEnabled: z245.boolean(),
7044
+ isApprovalRequiredForPublishing: z245.boolean()
7045
+ });
7046
+
7047
+ // src/api/dto/elements/documentation/structure.ts
7048
+ import { z as z246 } from "zod";
7049
+ var DTODocumentationStructureItemType = z246.enum(["Group", "Page"]);
7050
+ var DTODocumentationStructureItemBase = z246.object({
7041
7051
  type: DTODocumentationStructureItemType,
7042
- id: z245.string(),
7043
- designSystemVersionId: z245.string(),
7044
- shortPersistentId: z245.string(),
7045
- persistentId: z245.string(),
7046
- title: z245.string(),
7047
- createdAt: z245.coerce.date(),
7048
- updatedAt: z245.coerce.date()
7052
+ id: z246.string(),
7053
+ designSystemVersionId: z246.string(),
7054
+ shortPersistentId: z246.string(),
7055
+ persistentId: z246.string(),
7056
+ title: z246.string(),
7057
+ createdAt: z246.coerce.date(),
7058
+ updatedAt: z246.coerce.date()
7049
7059
  });
7050
7060
  var DTODocumentationStructureGroupItem = DTODocumentationStructureItemBase.extend({
7051
- type: z245.literal(DTODocumentationStructureItemType.enum.Group),
7052
- groupBehavior: z245.string(),
7053
- childrenIds: z245.string().array(),
7054
- isRoot: z245.boolean()
7061
+ type: z246.literal(DTODocumentationStructureItemType.enum.Group),
7062
+ groupBehavior: z246.string(),
7063
+ childrenIds: z246.string().array(),
7064
+ isRoot: z246.boolean()
7055
7065
  });
7056
7066
  var DTODocumentationStructurePageItem = DTODocumentationStructureItemBase.extend({
7057
- type: z245.literal(DTODocumentationStructureItemType.enum.Page),
7058
- path: z245.string()
7067
+ type: z246.literal(DTODocumentationStructureItemType.enum.Page),
7068
+ path: z246.string()
7059
7069
  });
7060
- var DTODocumentationStructureItem = z245.discriminatedUnion("type", [
7070
+ var DTODocumentationStructureItem = z246.discriminatedUnion("type", [
7061
7071
  DTODocumentationStructureGroupItem,
7062
7072
  DTODocumentationStructurePageItem
7063
7073
  ]);
7064
- var DTODocumentationStructure = z245.object({
7065
- items: z245.array(DTODocumentationStructureItem)
7074
+ var DTODocumentationStructure = z246.object({
7075
+ items: z246.array(DTODocumentationStructureItem)
7066
7076
  });
7067
7077
 
7068
7078
  // src/api/dto/elements/figma-nodes/figma-node-v1.ts
7069
- import { z as z247 } from "zod";
7079
+ import { z as z248 } from "zod";
7070
7080
 
7071
7081
  // src/api/dto/elements/figma-nodes/figma-node.ts
7072
- import { z as z246 } from "zod";
7082
+ import { z as z247 } from "zod";
7073
7083
  var DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
7074
- var DTOFigmaNodeOrigin = z246.object({
7075
- sourceId: z246.string(),
7076
- fileId: z246.string().optional(),
7077
- parentName: z246.string().optional()
7084
+ var DTOFigmaNodeOrigin = z247.object({
7085
+ sourceId: z247.string(),
7086
+ fileId: z247.string().optional(),
7087
+ parentName: z247.string().optional()
7078
7088
  });
7079
- var DTOFigmaNodeRenderInputBase = z246.object({
7089
+ var DTOFigmaNodeRenderInputBase = z247.object({
7080
7090
  /**
7081
7091
  * Format in which the node must be rendered, png by default.
7082
7092
  */
@@ -7084,57 +7094,57 @@ var DTOFigmaNodeRenderInputBase = z246.object({
7084
7094
  /**
7085
7095
  * Scale to apply to PNG images, can be between 1 and 4. Scale is ignored for other image formats.
7086
7096
  */
7087
- scale: z246.number().optional()
7097
+ scale: z247.number().optional()
7088
7098
  });
7089
7099
  var DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
7090
- inputType: z246.literal("NodeId").optional().transform((v) => v ?? "NodeId"),
7100
+ inputType: z247.literal("NodeId").optional().transform((v) => v ?? "NodeId"),
7091
7101
  /**
7092
7102
  * Id of a design system's data source representing a linked Figma file
7093
7103
  */
7094
- sourceId: z246.string(),
7104
+ sourceId: z247.string(),
7095
7105
  /**
7096
7106
  * Id of a node within the Figma file
7097
7107
  */
7098
- figmaFileNodeId: z246.string()
7108
+ figmaFileNodeId: z247.string()
7099
7109
  });
7100
7110
  var DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
7101
- inputType: z246.literal("URL"),
7111
+ inputType: z247.literal("URL"),
7102
7112
  /**
7103
7113
  * Id of a design system's data source representing a linked Figma file
7104
7114
  */
7105
- figmaNodeUrl: z246.string(),
7115
+ figmaNodeUrl: z247.string(),
7106
7116
  /**
7107
7117
  * Brand persistent id to use in case a source has to be created for this render
7108
7118
  */
7109
- brandPersistentId: z246.string()
7119
+ brandPersistentId: z247.string()
7110
7120
  });
7111
- var DTOFigmaNodeRerenderInput = z246.object({
7112
- inputType: z246.literal("Rerender"),
7121
+ var DTOFigmaNodeRerenderInput = z247.object({
7122
+ inputType: z247.literal("Rerender"),
7113
7123
  /**
7114
7124
  * Persistent ID of an existing Figma node
7115
7125
  */
7116
- figmaNodePersistentId: z246.string()
7126
+ figmaNodePersistentId: z247.string()
7117
7127
  });
7118
- var DTOFigmaNodeRenderInput = z246.discriminatedUnion("inputType", [
7128
+ var DTOFigmaNodeRenderInput = z247.discriminatedUnion("inputType", [
7119
7129
  DTOFigmaNodeRenderIdInput,
7120
7130
  DTOFigmaNodeRenderUrlInput,
7121
7131
  DTOFigmaNodeRerenderInput
7122
7132
  ]);
7123
7133
 
7124
7134
  // src/api/dto/elements/figma-nodes/figma-node-v1.ts
7125
- var DTOFigmaNodeData = z247.object({
7135
+ var DTOFigmaNodeData = z248.object({
7126
7136
  // Id of the node in the Figma file
7127
- figmaNodeId: z247.string(),
7137
+ figmaNodeId: z248.string(),
7128
7138
  // Validity
7129
- isValid: z247.boolean(),
7139
+ isValid: z248.boolean(),
7130
7140
  // Asset data
7131
- assetId: z247.string(),
7132
- assetUrl: z247.string(),
7141
+ assetId: z248.string(),
7142
+ assetUrl: z248.string(),
7133
7143
  assetFormat: DTOFigmaNodeRenderFormat,
7134
7144
  // Asset metadata
7135
- assetScale: z247.number(),
7136
- assetWidth: z247.number().optional(),
7137
- assetHeight: z247.number().optional()
7145
+ assetScale: z248.number(),
7146
+ assetWidth: z248.number().optional(),
7147
+ assetHeight: z248.number().optional()
7138
7148
  });
7139
7149
  var DTOFigmaNode = FigmaNodeReference.omit({
7140
7150
  data: true,
@@ -7145,15 +7155,15 @@ var DTOFigmaNode = FigmaNodeReference.omit({
7145
7155
  });
7146
7156
 
7147
7157
  // src/api/dto/elements/figma-nodes/figma-node-v2.ts
7148
- import { z as z248 } from "zod";
7149
- var DTOFigmaNodeDataV2 = z248.object({
7150
- sceneNodeId: z248.string(),
7158
+ import { z as z249 } from "zod";
7159
+ var DTOFigmaNodeDataV2 = z249.object({
7160
+ sceneNodeId: z249.string(),
7151
7161
  format: FigmaNodeRenderFormat,
7152
- scale: z248.number().optional(),
7162
+ scale: z249.number().optional(),
7153
7163
  renderState: FigmaNodeRenderState,
7154
7164
  renderedImage: FigmaNodeRenderedImage.optional(),
7155
7165
  renderError: FigmaNodeRenderError.optional(),
7156
- hasSource: z248.boolean()
7166
+ hasSource: z249.boolean()
7157
7167
  });
7158
7168
  var DTOFigmaNodeV2 = FigmaNodeReference.omit({
7159
7169
  data: true,
@@ -7164,105 +7174,105 @@ var DTOFigmaNodeV2 = FigmaNodeReference.omit({
7164
7174
  });
7165
7175
 
7166
7176
  // src/api/dto/elements/figma-nodes/node-actions-v2.ts
7167
- import { z as z249 } from "zod";
7168
- var DTOFigmaNodeRenderActionOutput = z249.object({
7169
- type: z249.literal("FigmaNodeRender"),
7170
- figmaNodes: z249.array(DTOFigmaNode)
7177
+ import { z as z250 } from "zod";
7178
+ var DTOFigmaNodeRenderActionOutput = z250.object({
7179
+ type: z250.literal("FigmaNodeRender"),
7180
+ figmaNodes: z250.array(DTOFigmaNode)
7171
7181
  });
7172
- var DTOFigmaNodeRenderAsyncActionOutput = z249.object({
7173
- type: z249.literal("FigmaNodeRenderAsync"),
7174
- figmaNodes: z249.array(DTOFigmaNodeV2)
7182
+ var DTOFigmaNodeRenderAsyncActionOutput = z250.object({
7183
+ type: z250.literal("FigmaNodeRenderAsync"),
7184
+ figmaNodes: z250.array(DTOFigmaNodeV2)
7175
7185
  });
7176
- var DTOFigmaNodeRenderActionInput = z249.object({
7177
- type: z249.literal("FigmaNodeRender"),
7186
+ var DTOFigmaNodeRenderActionInput = z250.object({
7187
+ type: z250.literal("FigmaNodeRender"),
7178
7188
  input: DTOFigmaNodeRenderIdInput.array()
7179
7189
  });
7180
- var DTOFigmaNodeRenderAsyncActionInput = z249.object({
7181
- type: z249.literal("FigmaNodeRenderAsync"),
7190
+ var DTOFigmaNodeRenderAsyncActionInput = z250.object({
7191
+ type: z250.literal("FigmaNodeRenderAsync"),
7182
7192
  nodes: DTOFigmaNodeRenderInput.array()
7183
7193
  });
7184
7194
 
7185
7195
  // src/api/dto/elements/frame-node-structures/frame-node-structure.ts
7186
- import { z as z250 } from "zod";
7187
- var DTOFrameNodeStructure = z250.object({
7188
- id: z250.string(),
7189
- persistentId: z250.string(),
7190
- designSystemVersionId: z250.string(),
7196
+ import { z as z251 } from "zod";
7197
+ var DTOFrameNodeStructure = z251.object({
7198
+ id: z251.string(),
7199
+ persistentId: z251.string(),
7200
+ designSystemVersionId: z251.string(),
7191
7201
  origin: FigmaFileStructureOrigin,
7192
7202
  assetsInFile: FigmaFileStructureStatistics
7193
7203
  });
7194
- var DTOFrameNodeStructureListResponse = z250.object({
7204
+ var DTOFrameNodeStructureListResponse = z251.object({
7195
7205
  structures: DTOFrameNodeStructure.array()
7196
7206
  });
7197
7207
 
7198
7208
  // src/api/dto/elements/properties/property-definitions.ts
7199
- import { z as z251 } from "zod";
7209
+ import { z as z252 } from "zod";
7200
7210
  var CODE_NAME_REGEX2 = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
7201
- var DTOElementPropertyDefinitionOption = z251.object({
7202
- id: z251.string(),
7203
- name: z251.string(),
7211
+ var DTOElementPropertyDefinitionOption = z252.object({
7212
+ id: z252.string(),
7213
+ name: z252.string(),
7204
7214
  backgroundColor: DTOColorTokenInlineData.optional()
7205
7215
  });
7206
- var DTOElementPropertyDefinition = z251.object({
7207
- id: z251.string(),
7208
- designSystemVersionId: z251.string(),
7216
+ var DTOElementPropertyDefinition = z252.object({
7217
+ id: z252.string(),
7218
+ designSystemVersionId: z252.string(),
7209
7219
  meta: DTOObjectMeta,
7210
- persistentId: z251.string(),
7220
+ persistentId: z252.string(),
7211
7221
  type: ElementPropertyTypeSchema,
7212
7222
  targetElementType: ElementPropertyTargetType,
7213
- codeName: z251.string().regex(CODE_NAME_REGEX2),
7214
- options: nullishToOptional(z251.array(DTOElementPropertyDefinitionOption)),
7223
+ codeName: z252.string().regex(CODE_NAME_REGEX2),
7224
+ options: nullishToOptional(z252.array(DTOElementPropertyDefinitionOption)),
7215
7225
  linkElementType: nullishToOptional(ElementPropertyLinkType),
7216
- isImmutable: z251.boolean(),
7226
+ isImmutable: z252.boolean(),
7217
7227
  immutablePropertyType: ElementPropertyImmutableType.optional()
7218
7228
  });
7219
- var DTOElementPropertyDefinitionListResponse = z251.object({
7220
- definitions: z251.array(DTOElementPropertyDefinition)
7229
+ var DTOElementPropertyDefinitionListResponse = z252.object({
7230
+ definitions: z252.array(DTOElementPropertyDefinition)
7221
7231
  });
7222
- var DTOElementPropertyDefinitionResponse = z251.object({
7232
+ var DTOElementPropertyDefinitionResponse = z252.object({
7223
7233
  definition: DTOElementPropertyDefinition
7224
7234
  });
7225
- var DTOElementPropertyDefinitionCreatePayload = z251.object({
7235
+ var DTOElementPropertyDefinitionCreatePayload = z252.object({
7226
7236
  meta: DTOObjectMeta,
7227
- persistentId: z251.string(),
7237
+ persistentId: z252.string(),
7228
7238
  type: ElementPropertyTypeSchema,
7229
7239
  targetElementType: ElementPropertyTargetType,
7230
- codeName: z251.string().regex(CODE_NAME_REGEX2),
7231
- options: nullishToOptional(z251.array(DTOElementPropertyDefinitionOption)),
7240
+ codeName: z252.string().regex(CODE_NAME_REGEX2),
7241
+ options: nullishToOptional(z252.array(DTOElementPropertyDefinitionOption)),
7232
7242
  linkElementType: nullishToOptional(ElementPropertyLinkType),
7233
- columnWidth: z251.number().max(1024).optional()
7243
+ columnWidth: z252.number().max(1024).optional()
7234
7244
  });
7235
- var DTOElementPropertyDefinitionUpdatePayload = z251.object({
7245
+ var DTOElementPropertyDefinitionUpdatePayload = z252.object({
7236
7246
  meta: DTOObjectMeta.optional(),
7237
- codeName: z251.string().regex(CODE_NAME_REGEX2).optional(),
7238
- options: z251.array(DTOElementPropertyDefinitionOption).optional()
7247
+ codeName: z252.string().regex(CODE_NAME_REGEX2).optional(),
7248
+ options: z252.array(DTOElementPropertyDefinitionOption).optional()
7239
7249
  });
7240
7250
 
7241
7251
  // src/api/dto/elements/properties/property-values.ts
7242
- import { z as z252 } from "zod";
7243
- var DTOElementPropertyValue = z252.object({
7244
- id: z252.string(),
7245
- designSystemVersionId: z252.string(),
7246
- definitionId: z252.string(),
7247
- targetElementId: z252.string(),
7248
- value: z252.union([z252.string(), z252.number(), z252.boolean()]).optional(),
7249
- valuePreview: z252.string().optional()
7250
- });
7251
- var DTOElementPropertyValueListResponse = z252.object({
7252
- values: z252.array(DTOElementPropertyValue)
7253
- });
7254
- var DTOElementPropertyValueResponse = z252.object({
7252
+ import { z as z253 } from "zod";
7253
+ var DTOElementPropertyValue = z253.object({
7254
+ id: z253.string(),
7255
+ designSystemVersionId: z253.string(),
7256
+ definitionId: z253.string(),
7257
+ targetElementId: z253.string(),
7258
+ value: z253.union([z253.string(), z253.number(), z253.boolean()]).optional(),
7259
+ valuePreview: z253.string().optional()
7260
+ });
7261
+ var DTOElementPropertyValueListResponse = z253.object({
7262
+ values: z253.array(DTOElementPropertyValue)
7263
+ });
7264
+ var DTOElementPropertyValueResponse = z253.object({
7255
7265
  value: DTOElementPropertyValue
7256
7266
  });
7257
- var DTOElementPropertyValueUpsertPaylod = z252.object({
7258
- definitionId: z252.string(),
7259
- targetElementId: z252.string(),
7260
- value: z252.string().or(z252.number()).or(z252.boolean())
7267
+ var DTOElementPropertyValueUpsertPaylod = z253.object({
7268
+ definitionId: z253.string(),
7269
+ targetElementId: z253.string(),
7270
+ value: z253.string().or(z253.number()).or(z253.boolean())
7261
7271
  });
7262
7272
 
7263
7273
  // src/api/dto/elements/elements-action-v2.ts
7264
- import { z as z253 } from "zod";
7265
- var DTOElementActionOutput = z253.discriminatedUnion("type", [
7274
+ import { z as z254 } from "zod";
7275
+ var DTOElementActionOutput = z254.discriminatedUnion("type", [
7266
7276
  // Documentation pages
7267
7277
  DTODocumentationPageCreateActionOutputV2,
7268
7278
  DTODocumentationPageUpdateActionOutputV2,
@@ -7286,7 +7296,7 @@ var DTOElementActionOutput = z253.discriminatedUnion("type", [
7286
7296
  // Approvals
7287
7297
  DTODocumentationPageApprovalStateChangeActionOutput
7288
7298
  ]);
7289
- var DTOElementActionInput = z253.discriminatedUnion("type", [
7299
+ var DTOElementActionInput = z254.discriminatedUnion("type", [
7290
7300
  // Documentation pages
7291
7301
  DTODocumentationPageCreateActionInputV2,
7292
7302
  DTODocumentationPageUpdateActionInputV2,
@@ -7310,90 +7320,90 @@ var DTOElementActionInput = z253.discriminatedUnion("type", [
7310
7320
  // Approval
7311
7321
  DTODocumentationPageApprovalStateChangeActionInput
7312
7322
  ]).and(
7313
- z253.object({
7314
- tId: z253.string().optional()
7323
+ z254.object({
7324
+ tId: z254.string().optional()
7315
7325
  })
7316
7326
  );
7317
7327
 
7318
7328
  // src/api/dto/elements/get-elements-v2.ts
7319
- import { z as z254 } from "zod";
7320
- var DTOElementsGetTypeFilter = z254.enum(["FigmaNode"]);
7321
- var DTOElementsGetQuerySchema = z254.object({
7322
- types: z254.string().transform((val) => val.split(",").map((v) => DTOElementsGetTypeFilter.parse(v))),
7323
- responseVersion: z254.coerce.number().default(1)
7329
+ import { z as z255 } from "zod";
7330
+ var DTOElementsGetTypeFilter = z255.enum(["FigmaNode"]);
7331
+ var DTOElementsGetQuerySchema = z255.object({
7332
+ types: z255.string().transform((val) => val.split(",").map((v) => DTOElementsGetTypeFilter.parse(v))),
7333
+ responseVersion: z255.coerce.number().default(1)
7324
7334
  });
7325
- var DTOElementsGetOutput = z254.object({
7326
- figmaNodes: z254.array(DTOFigmaNode).optional()
7335
+ var DTOElementsGetOutput = z255.object({
7336
+ figmaNodes: z255.array(DTOFigmaNode).optional()
7327
7337
  });
7328
- var DTOElementsGetOutputV2 = z254.object({
7329
- figmaNodes: z254.array(DTOFigmaNodeV2).optional()
7338
+ var DTOElementsGetOutputV2 = z255.object({
7339
+ figmaNodes: z255.array(DTOFigmaNodeV2).optional()
7330
7340
  });
7331
7341
 
7332
7342
  // src/api/dto/figma-components/assets/download.ts
7333
- import { z as z255 } from "zod";
7334
- var DTOAssetRenderConfiguration = z255.object({
7335
- prefix: z255.string().optional(),
7336
- suffix: z255.string().optional(),
7337
- scale: z255.enum(["x1", "x2", "x3", "x4"]),
7338
- format: z255.enum(["png", "pdf", "svg"])
7339
- });
7340
- var DTORenderedAssetFile = z255.object({
7341
- assetId: z255.string(),
7342
- fileName: z255.string(),
7343
- sourceUrl: z255.string(),
7343
+ import { z as z256 } from "zod";
7344
+ var DTOAssetRenderConfiguration = z256.object({
7345
+ prefix: z256.string().optional(),
7346
+ suffix: z256.string().optional(),
7347
+ scale: z256.enum(["x1", "x2", "x3", "x4"]),
7348
+ format: z256.enum(["png", "pdf", "svg"])
7349
+ });
7350
+ var DTORenderedAssetFile = z256.object({
7351
+ assetId: z256.string(),
7352
+ fileName: z256.string(),
7353
+ sourceUrl: z256.string(),
7344
7354
  settings: DTOAssetRenderConfiguration,
7345
- originalName: z255.string()
7355
+ originalName: z256.string()
7346
7356
  });
7347
- var DTODownloadAssetsRequest = z255.object({
7348
- persistentIds: z255.array(z255.string().uuid()).optional(),
7357
+ var DTODownloadAssetsRequest = z256.object({
7358
+ persistentIds: z256.array(z256.string().uuid()).optional(),
7349
7359
  settings: DTOAssetRenderConfiguration.array()
7350
7360
  });
7351
- var DTODownloadAssetsResponse = z255.object({
7361
+ var DTODownloadAssetsResponse = z256.object({
7352
7362
  items: DTORenderedAssetFile.array()
7353
7363
  });
7354
7364
 
7355
7365
  // src/api/dto/liveblocks/auth-response.ts
7356
- import { z as z256 } from "zod";
7357
- var DTOLiveblocksAuthResponse = z256.object({
7358
- token: z256.string()
7366
+ import { z as z257 } from "zod";
7367
+ var DTOLiveblocksAuthResponse = z257.object({
7368
+ token: z257.string()
7359
7369
  });
7360
7370
 
7361
7371
  // src/api/dto/themes/override.ts
7362
- import { z as z257 } from "zod";
7372
+ import { z as z258 } from "zod";
7363
7373
  var DTOThemeOverride = DesignTokenTypedData.and(
7364
- z257.object({
7365
- tokenPersistentId: z257.string(),
7374
+ z258.object({
7375
+ tokenPersistentId: z258.string(),
7366
7376
  origin: ThemeOverrideOrigin.optional()
7367
7377
  })
7368
7378
  );
7369
7379
  var DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
7370
- z257.object({
7371
- tokenPersistentId: z257.string()
7380
+ z258.object({
7381
+ tokenPersistentId: z258.string()
7372
7382
  })
7373
7383
  );
7374
7384
 
7375
7385
  // src/api/dto/themes/theme.ts
7376
- import { z as z258 } from "zod";
7377
- var DTOTheme = z258.object({
7378
- id: z258.string(),
7379
- persistentId: z258.string(),
7380
- designSystemVersionId: z258.string(),
7381
- brandId: z258.string(),
7386
+ import { z as z259 } from "zod";
7387
+ var DTOTheme = z259.object({
7388
+ id: z259.string(),
7389
+ persistentId: z259.string(),
7390
+ designSystemVersionId: z259.string(),
7391
+ brandId: z259.string(),
7382
7392
  meta: ObjectMeta,
7383
- codeName: z258.string(),
7393
+ codeName: z259.string(),
7384
7394
  overrides: DTOThemeOverride.array()
7385
7395
  });
7386
- var DTOThemeResponse = z258.object({
7396
+ var DTOThemeResponse = z259.object({
7387
7397
  theme: DTOTheme
7388
7398
  });
7389
- var DTOThemeListResponse = z258.object({
7399
+ var DTOThemeListResponse = z259.object({
7390
7400
  themes: DTOTheme.array()
7391
7401
  });
7392
- var DTOThemeCreatePayload = z258.object({
7402
+ var DTOThemeCreatePayload = z259.object({
7393
7403
  meta: ObjectMeta,
7394
- persistentId: z258.string(),
7395
- brandId: z258.string(),
7396
- codeName: z258.string(),
7404
+ persistentId: z259.string(),
7405
+ brandId: z259.string(),
7406
+ codeName: z259.string(),
7397
7407
  overrides: DTOThemeOverride.array()
7398
7408
  });
7399
7409
 
@@ -7536,13 +7546,13 @@ var ExportersEndpoint = class {
7536
7546
  };
7537
7547
 
7538
7548
  // src/api/endpoints/codegen/jobs.ts
7539
- import { z as z259 } from "zod";
7549
+ import { z as z260 } from "zod";
7540
7550
  var ExporterJobsEndpoint = class {
7541
7551
  constructor(requestExecutor) {
7542
7552
  this.requestExecutor = requestExecutor;
7543
7553
  }
7544
7554
  list(workspaceId) {
7545
- return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z259.any());
7555
+ return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z260.any());
7546
7556
  }
7547
7557
  get(workspaceId, jobId) {
7548
7558
  return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);
@@ -7600,7 +7610,7 @@ var CodegenEndpoint = class {
7600
7610
  };
7601
7611
 
7602
7612
  // src/api/endpoints/design-system/versions/brands.ts
7603
- import { z as z260 } from "zod";
7613
+ import { z as z261 } from "zod";
7604
7614
  var BrandsEndpoint = class {
7605
7615
  constructor(requestExecutor) {
7606
7616
  this.requestExecutor = requestExecutor;
@@ -7634,7 +7644,7 @@ var BrandsEndpoint = class {
7634
7644
  });
7635
7645
  }
7636
7646
  delete(dsId, vId, brandId) {
7637
- return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z260.any(), {
7647
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z261.any(), {
7638
7648
  method: "DELETE"
7639
7649
  });
7640
7650
  }
@@ -7803,7 +7813,7 @@ var ImportJobsEndpoint = class {
7803
7813
  };
7804
7814
 
7805
7815
  // src/api/endpoints/design-system/versions/overrides.ts
7806
- import { z as z261 } from "zod";
7816
+ import { z as z262 } from "zod";
7807
7817
  var OverridesEndpoint = class {
7808
7818
  constructor(requestExecutor) {
7809
7819
  this.requestExecutor = requestExecutor;
@@ -7811,7 +7821,7 @@ var OverridesEndpoint = class {
7811
7821
  create(dsId, versionId, themeId, body) {
7812
7822
  return this.requestExecutor.json(
7813
7823
  `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,
7814
- z261.any(),
7824
+ z262.any(),
7815
7825
  {
7816
7826
  method: "POST",
7817
7827
  body
@@ -7821,7 +7831,7 @@ var OverridesEndpoint = class {
7821
7831
  };
7822
7832
 
7823
7833
  // src/api/endpoints/design-system/versions/property-definitions.ts
7824
- import { z as z262 } from "zod";
7834
+ import { z as z263 } from "zod";
7825
7835
  var ElementPropertyDefinitionsEndpoint = class {
7826
7836
  constructor(requestExecutor) {
7827
7837
  this.requestExecutor = requestExecutor;
@@ -7849,7 +7859,7 @@ var ElementPropertyDefinitionsEndpoint = class {
7849
7859
  delete(designSystemId, versionId, defId) {
7850
7860
  return this.requestExecutor.json(
7851
7861
  `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,
7852
- z262.any(),
7862
+ z263.any(),
7853
7863
  { method: "DELETE" }
7854
7864
  );
7855
7865
  }
@@ -7888,7 +7898,7 @@ var VersionStatsEndpoint = class {
7888
7898
  };
7889
7899
 
7890
7900
  // src/api/endpoints/design-system/versions/themes.ts
7891
- import { z as z263 } from "zod";
7901
+ import { z as z264 } from "zod";
7892
7902
  var ThemesEndpoint = class {
7893
7903
  constructor(requestExecutor) {
7894
7904
  this.requestExecutor = requestExecutor;
@@ -7911,7 +7921,7 @@ var ThemesEndpoint = class {
7911
7921
  });
7912
7922
  }
7913
7923
  delete(dsId, versionId, themeId) {
7914
- return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z263.any(), {
7924
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z264.any(), {
7915
7925
  method: "DELETE"
7916
7926
  });
7917
7927
  }
@@ -8064,7 +8074,7 @@ var DesignSystemContactsEndpoint = class {
8064
8074
  };
8065
8075
 
8066
8076
  // src/api/endpoints/design-system/design-systems.ts
8067
- import { z as z265 } from "zod";
8077
+ import { z as z266 } from "zod";
8068
8078
 
8069
8079
  // src/api/endpoints/design-system/members.ts
8070
8080
  var DesignSystemMembersEndpoint = class {
@@ -8085,7 +8095,7 @@ var DesignSystemMembersEndpoint = class {
8085
8095
  };
8086
8096
 
8087
8097
  // src/api/endpoints/design-system/sources.ts
8088
- import { z as z264 } from "zod";
8098
+ import { z as z265 } from "zod";
8089
8099
  var DesignSystemSourcesEndpoint = class {
8090
8100
  constructor(requestExecutor) {
8091
8101
  this.requestExecutor = requestExecutor;
@@ -8100,7 +8110,7 @@ var DesignSystemSourcesEndpoint = class {
8100
8110
  return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
8101
8111
  }
8102
8112
  delete(dsId, sourceId) {
8103
- return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z264.any(), { method: "DELETE" });
8113
+ return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z265.any(), { method: "DELETE" });
8104
8114
  }
8105
8115
  figmaImport(dsId, payload) {
8106
8116
  return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {
@@ -8135,7 +8145,7 @@ var DesignSystemsEndpoint = class {
8135
8145
  return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
8136
8146
  }
8137
8147
  delete(dsId) {
8138
- return this.requestExecutor.json(`/design-systems/${dsId}`, z265.any(), { method: "DELETE" });
8148
+ return this.requestExecutor.json(`/design-systems/${dsId}`, z266.any(), { method: "DELETE" });
8139
8149
  }
8140
8150
  update(dsId, body) {
8141
8151
  return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
@@ -8179,7 +8189,7 @@ var WorkspaceInvitationsEndpoint = class {
8179
8189
  };
8180
8190
 
8181
8191
  // src/api/endpoints/workspaces/workspace-members.ts
8182
- import { z as z266 } from "zod";
8192
+ import { z as z267 } from "zod";
8183
8193
  var WorkspaceMembersEndpoint = class {
8184
8194
  constructor(requestExecutor) {
8185
8195
  this.requestExecutor = requestExecutor;
@@ -8196,7 +8206,7 @@ var WorkspaceMembersEndpoint = class {
8196
8206
  });
8197
8207
  }
8198
8208
  invite(workspaceId, body) {
8199
- return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z266.any(), { method: "POST", body });
8209
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z267.any(), { method: "POST", body });
8200
8210
  }
8201
8211
  delete(workspaceId, userId) {
8202
8212
  return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {
@@ -8206,7 +8216,7 @@ var WorkspaceMembersEndpoint = class {
8206
8216
  };
8207
8217
 
8208
8218
  // src/api/endpoints/workspaces/workspaces.ts
8209
- import { z as z267 } from "zod";
8219
+ import { z as z268 } from "zod";
8210
8220
  var WorkspacesEndpoint = class {
8211
8221
  constructor(requestExecutor) {
8212
8222
  this.requestExecutor = requestExecutor;
@@ -8229,10 +8239,10 @@ var WorkspacesEndpoint = class {
8229
8239
  return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: "GET" });
8230
8240
  }
8231
8241
  delete(workspaceId) {
8232
- return this.requestExecutor.json(`/workspaces/${workspaceId}`, z267.any(), { method: "DELETE" });
8242
+ return this.requestExecutor.json(`/workspaces/${workspaceId}`, z268.any(), { method: "DELETE" });
8233
8243
  }
8234
8244
  subscription(workspaceId) {
8235
- return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z267.any(), { method: "GET" });
8245
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z268.any(), { method: "GET" });
8236
8246
  }
8237
8247
  transferOwnership(workspaceId, body) {
8238
8248
  return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {
@@ -8332,9 +8342,9 @@ ${bodyText}`,
8332
8342
 
8333
8343
  // src/api/transport/request-executor.ts
8334
8344
  import fetch from "node-fetch";
8335
- import { z as z268 } from "zod";
8336
- var ResponseWrapper = z268.object({
8337
- result: z268.record(z268.any())
8345
+ import { z as z269 } from "zod";
8346
+ var ResponseWrapper = z269.object({
8347
+ result: z269.record(z269.any())
8338
8348
  });
8339
8349
  var RequestExecutor = class {
8340
8350
  constructor(testServerConfig) {
@@ -8411,31 +8421,31 @@ var SupernovaApiClient = class {
8411
8421
  };
8412
8422
 
8413
8423
  // src/events/design-system.ts
8414
- import { z as z269 } from "zod";
8415
- var DTOEventFigmaNodesRendered = z269.object({
8416
- type: z269.literal("DesignSystem.FigmaNodesRendered"),
8417
- designSystemId: z269.string(),
8418
- versionId: z269.string(),
8419
- figmaNodePersistentIds: z269.string().array()
8420
- });
8421
- var DTOEventDataSourcesImported = z269.object({
8422
- type: z269.literal("DesignSystem.ImportJobFinished"),
8423
- designSystemId: z269.string(),
8424
- versionId: z269.string(),
8425
- importJobId: z269.string(),
8424
+ import { z as z270 } from "zod";
8425
+ var DTOEventFigmaNodesRendered = z270.object({
8426
+ type: z270.literal("DesignSystem.FigmaNodesRendered"),
8427
+ designSystemId: z270.string(),
8428
+ versionId: z270.string(),
8429
+ figmaNodePersistentIds: z270.string().array()
8430
+ });
8431
+ var DTOEventDataSourcesImported = z270.object({
8432
+ type: z270.literal("DesignSystem.ImportJobFinished"),
8433
+ designSystemId: z270.string(),
8434
+ versionId: z270.string(),
8435
+ importJobId: z270.string(),
8426
8436
  dataSourceType: DataSourceRemoteType,
8427
- dataSourceIds: z269.string().array()
8437
+ dataSourceIds: z270.string().array()
8428
8438
  });
8429
8439
 
8430
8440
  // src/events/event.ts
8431
- import { z as z270 } from "zod";
8432
- var DTOEvent = z270.discriminatedUnion("type", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);
8441
+ import { z as z271 } from "zod";
8442
+ var DTOEvent = z271.discriminatedUnion("type", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);
8433
8443
 
8434
8444
  // src/sync/docs-structure-repo.ts
8435
8445
  import PQueue from "p-queue";
8436
8446
 
8437
8447
  // src/yjs/design-system-content/documentation-hierarchy.ts
8438
- import { z as z271 } from "zod";
8448
+ import { z as z272 } from "zod";
8439
8449
 
8440
8450
  // src/yjs/version-room/base.ts
8441
8451
  var VersionRoomBaseYDoc = class {
@@ -8657,8 +8667,12 @@ function computeDocsHierarchy(input, options = {}) {
8657
8667
  }
8658
8668
  const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion, recordToMap(pageLiveblockRoomIds));
8659
8669
  const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
8670
+ const hasPublishedPages = pageSnapshots.some((s) => s.reason === "Publish");
8671
+ const hasPublishedGroups = groupSnapshots.some((s) => s.reason === "Publish");
8672
+ const hasPublishedDocumentationContent = hasPublishedPages || hasPublishedGroups;
8660
8673
  if (!settings.isDraftFeatureAdopted) {
8661
8674
  return {
8675
+ hasPublishedDocumentationContent,
8662
8676
  pages: pageDTOs,
8663
8677
  groups: groupDTOs
8664
8678
  };
@@ -8688,6 +8702,7 @@ function computeDocsHierarchy(input, options = {}) {
8688
8702
  approvalState && (g.approvalState = approvalState);
8689
8703
  });
8690
8704
  return {
8705
+ hasPublishedDocumentationContent,
8691
8706
  pages: pageDTOs,
8692
8707
  groups: groupDTOs
8693
8708
  };
@@ -8995,24 +9010,24 @@ var FrontendVersionRoomYDoc = class {
8995
9010
  };
8996
9011
 
8997
9012
  // src/yjs/design-system-content/documentation-hierarchy.ts
8998
- var DocumentationHierarchySettings = z271.object({
8999
- routingVersion: z271.string(),
9000
- isDraftFeatureAdopted: z271.boolean(),
9001
- isApprovalFeatureEnabled: z271.boolean(),
9002
- approvalRequiredForPublishing: z271.boolean()
9013
+ var DocumentationHierarchySettings = z272.object({
9014
+ routingVersion: z272.string(),
9015
+ isDraftFeatureAdopted: z272.boolean(),
9016
+ isApprovalFeatureEnabled: z272.boolean(),
9017
+ approvalRequiredForPublishing: z272.boolean()
9003
9018
  });
9004
9019
  function yjsToDocumentationHierarchy(doc) {
9005
9020
  return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
9006
9021
  }
9007
9022
 
9008
9023
  // src/yjs/design-system-content/item-configuration.ts
9009
- import { z as z272 } from "zod";
9010
- var DTODocumentationPageRoomHeaderData = z272.object({
9011
- title: z272.string(),
9024
+ import { z as z273 } from "zod";
9025
+ var DTODocumentationPageRoomHeaderData = z273.object({
9026
+ title: z273.string(),
9012
9027
  configuration: DTODocumentationItemConfigurationV2
9013
9028
  });
9014
- var DTODocumentationPageRoomHeaderDataUpdate = z272.object({
9015
- title: z272.string().optional(),
9029
+ var DTODocumentationPageRoomHeaderDataUpdate = z273.object({
9030
+ title: z273.string().optional(),
9016
9031
  configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
9017
9032
  });
9018
9033
  function itemConfigurationToYjs(yDoc, item) {
@@ -9063,7 +9078,7 @@ function yjsToItemConfiguration(yDoc) {
9063
9078
  header: rawHeader
9064
9079
  };
9065
9080
  return {
9066
- title: z272.string().parse(title),
9081
+ title: z273.string().parse(title),
9067
9082
  configuration: DTODocumentationItemConfigurationV2.parse(rawConfig)
9068
9083
  };
9069
9084
  }
@@ -9073,9 +9088,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
9073
9088
  var PageSectionEditorModel = PageSectionEditorModelV2;
9074
9089
 
9075
9090
  // src/yjs/docs-editor/model/page.ts
9076
- import { z as z273 } from "zod";
9077
- var DocumentationPageEditorModel = z273.object({
9078
- blocks: z273.array(DocumentationPageContentItem)
9091
+ import { z as z274 } from "zod";
9092
+ var DocumentationPageEditorModel = z274.object({
9093
+ blocks: z274.array(DocumentationPageContentItem)
9079
9094
  });
9080
9095
 
9081
9096
  // src/yjs/docs-editor/prosemirror/inner-editor-schema.ts
@@ -12634,7 +12649,7 @@ var blocks = [
12634
12649
 
12635
12650
  // src/yjs/docs-editor/prosemirror-to-blocks.ts
12636
12651
  import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
12637
- import { z as z274 } from "zod";
12652
+ import { z as z275 } from "zod";
12638
12653
  function yDocToPage(yDoc, definitions) {
12639
12654
  return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
12640
12655
  }
@@ -12714,7 +12729,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
12714
12729
  return null;
12715
12730
  return {
12716
12731
  id,
12717
- title: getProsemirrorAttribute(prosemirrorNode, "title", z274.string()) ?? "",
12732
+ title: getProsemirrorAttribute(prosemirrorNode, "title", z275.string()) ?? "",
12718
12733
  columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
12719
12734
  };
12720
12735
  }
@@ -12749,7 +12764,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
12749
12764
  });
12750
12765
  }
12751
12766
  function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
12752
- const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z274.string());
12767
+ const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z275.string());
12753
12768
  if (!definitionId) {
12754
12769
  console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
12755
12770
  return [];
@@ -12791,7 +12806,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
12791
12806
  if (!id)
12792
12807
  return null;
12793
12808
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12794
- const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z274.string().optional()));
12809
+ const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z275.string().optional()));
12795
12810
  return {
12796
12811
  id,
12797
12812
  type: "Block",
@@ -12919,10 +12934,10 @@ function parseRichTextAttribute(mark) {
12919
12934
  return null;
12920
12935
  }
12921
12936
  function parseProsemirrorLink(mark) {
12922
- const href = getProsemirrorAttribute(mark, "href", z274.string().optional());
12937
+ const href = getProsemirrorAttribute(mark, "href", z275.string().optional());
12923
12938
  if (!href)
12924
12939
  return null;
12925
- const target = getProsemirrorAttribute(mark, "target", z274.string().optional());
12940
+ const target = getProsemirrorAttribute(mark, "target", z275.string().optional());
12926
12941
  const openInNewTab = target === "_blank";
12927
12942
  if (href.startsWith("@")) {
12928
12943
  return {
@@ -12941,10 +12956,10 @@ function parseProsemirrorLink(mark) {
12941
12956
  }
12942
12957
  }
12943
12958
  function parseProsemirrorCommentHighlight(mark) {
12944
- const highlightId = getProsemirrorAttribute(mark, "highlightId", z274.string().optional());
12959
+ const highlightId = getProsemirrorAttribute(mark, "highlightId", z275.string().optional());
12945
12960
  if (!highlightId)
12946
12961
  return null;
12947
- const isResolved = getProsemirrorAttribute(mark, "resolved", z274.boolean().optional()) ?? false;
12962
+ const isResolved = getProsemirrorAttribute(mark, "resolved", z275.boolean().optional()) ?? false;
12948
12963
  return {
12949
12964
  type: "Comment",
12950
12965
  commentHighlightId: highlightId,
@@ -12956,7 +12971,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
12956
12971
  if (!id)
12957
12972
  return null;
12958
12973
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12959
- const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z274.boolean().optional()) !== false;
12974
+ const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z275.boolean().optional()) !== false;
12960
12975
  const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
12961
12976
  if (!tableChild) {
12962
12977
  return emptyTable(id, variantId, 0);
@@ -13003,9 +13018,9 @@ function parseAsTableCell(prosemirrorNode) {
13003
13018
  const id = getProsemirrorBlockId(prosemirrorNode);
13004
13019
  if (!id)
13005
13020
  return null;
13006
- const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z274.string().optional());
13021
+ const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z275.string().optional());
13007
13022
  let columnWidth;
13008
- const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z274.array(z274.number()).nullish());
13023
+ const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z275.array(z275.number()).nullish());
13009
13024
  if (columnWidthArray) {
13010
13025
  columnWidth = roundDimension(columnWidthArray[0]);
13011
13026
  }
@@ -13043,7 +13058,7 @@ function parseAsTableNode(prosemirrorNode) {
13043
13058
  value: parseRichText(prosemirrorNode.content ?? [])
13044
13059
  };
13045
13060
  case "image":
13046
- const items = getProsemirrorAttribute(prosemirrorNode, "items", z274.string());
13061
+ const items = getProsemirrorAttribute(prosemirrorNode, "items", z275.string());
13047
13062
  if (!items)
13048
13063
  return null;
13049
13064
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
@@ -13163,7 +13178,7 @@ function definitionExpectsPlaceholderItem(definition) {
13163
13178
  );
13164
13179
  }
13165
13180
  function parseBlockItems(prosemirrorNode, definition) {
13166
- const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z274.string());
13181
+ const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z275.string());
13167
13182
  if (!itemsString)
13168
13183
  return null;
13169
13184
  const itemsJson = JSON.parse(itemsString);
@@ -13175,18 +13190,18 @@ function parseBlockItems(prosemirrorNode, definition) {
13175
13190
  }
13176
13191
  function parseAppearance(prosemirrorNode) {
13177
13192
  let appearance = {};
13178
- const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z274.string().optional());
13193
+ const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z275.string().optional());
13179
13194
  if (rawAppearanceString) {
13180
13195
  const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
13181
13196
  if (parsedAppearance.success) {
13182
13197
  appearance = parsedAppearance.data;
13183
13198
  }
13184
13199
  }
13185
- const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z274.number().optional());
13200
+ const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z275.number().optional());
13186
13201
  if (columns) {
13187
13202
  appearance.numberOfColumns = columns;
13188
13203
  }
13189
- const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z274.string().optional());
13204
+ const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z275.string().optional());
13190
13205
  if (backgroundColor) {
13191
13206
  const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
13192
13207
  if (parsedColor.success) {
@@ -13281,13 +13296,13 @@ function valueSchemaForPropertyType(type) {
13281
13296
  }
13282
13297
  }
13283
13298
  function getProsemirrorBlockId(prosemirrorNode) {
13284
- const id = getProsemirrorAttribute(prosemirrorNode, "id", z274.string());
13299
+ const id = getProsemirrorAttribute(prosemirrorNode, "id", z275.string());
13285
13300
  if (!id)
13286
13301
  console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
13287
13302
  return id;
13288
13303
  }
13289
13304
  function getProsemirrorBlockVariantId(prosemirrorNode) {
13290
- return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z274.string()));
13305
+ return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z275.string()));
13291
13306
  }
13292
13307
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
13293
13308
  const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
@@ -13498,9 +13513,11 @@ var DocsStructureRepository = class {
13498
13513
  __publicField(this, "yObserver");
13499
13514
  __publicField(this, "_yState");
13500
13515
  __publicField(this, "_currentHierarchy");
13516
+ __publicField(this, "_currentSettings");
13501
13517
  __publicField(this, "localActions", []);
13502
13518
  __publicField(this, "actionQueue");
13503
13519
  __publicField(this, "hierarchyObservers", /* @__PURE__ */ new Set());
13520
+ __publicField(this, "settingsObservers", /* @__PURE__ */ new Set());
13504
13521
  __publicField(this, "initCallbacks", /* @__PURE__ */ new Set());
13505
13522
  __publicField(this, "transactionIdGenerator");
13506
13523
  this.designSystemVersionId = config.designSystemVersionId;
@@ -13531,6 +13548,14 @@ var DocsStructureRepository = class {
13531
13548
  removeHierarchyObserver(observer) {
13532
13549
  this.hierarchyObservers.delete(observer);
13533
13550
  }
13551
+ addSettingsObserver(observer) {
13552
+ this.settingsObservers.add(observer);
13553
+ if (this._currentSettings)
13554
+ observer(this._currentSettings);
13555
+ }
13556
+ removeSettingsObserver(observer) {
13557
+ this.settingsObservers.delete(observer);
13558
+ }
13534
13559
  dispose() {
13535
13560
  this.yDoc.off("update", this.yObserver);
13536
13561
  this.hierarchyObservers.clear();
@@ -13560,40 +13585,61 @@ var DocsStructureRepository = class {
13560
13585
  //
13561
13586
  // Reactions
13562
13587
  //
13588
+ refreshState() {
13589
+ this.refreshHierarchy();
13590
+ this.refreshSettings();
13591
+ }
13592
+ refreshSettings() {
13593
+ const yState = this._yState;
13594
+ if (!yState)
13595
+ return;
13596
+ const newSettings = {
13597
+ isApprovalRequiredForPublishing: yState.settings.approvalRequiredForPublishing,
13598
+ isApprovalsFeatureEnabled: yState.settings.isApprovalFeatureEnabled,
13599
+ isDraftFeatureAdopted: yState.settings.isDraftFeatureAdopted
13600
+ };
13601
+ if (!this._currentSettings || newSettings.isApprovalRequiredForPublishing !== this._currentSettings.isApprovalRequiredForPublishing || newSettings.isApprovalsFeatureEnabled !== this._currentSettings.isApprovalsFeatureEnabled || newSettings.isDraftFeatureAdopted !== this._currentSettings.isDraftFeatureAdopted) {
13602
+ this._currentSettings = newSettings;
13603
+ this.settingsObservers.forEach((o) => o(newSettings));
13604
+ }
13605
+ }
13563
13606
  refreshHierarchy() {
13564
- const hierarchy = this.calculateHierarchy();
13607
+ const yState = this._yState;
13608
+ if (!yState)
13609
+ return;
13610
+ const hierarchy = this.calculateHierarchy(yState);
13565
13611
  if (!hierarchy)
13566
13612
  return;
13567
13613
  this._currentHierarchy = hierarchy;
13568
- this.initCallbacks.forEach((f) => f());
13569
- this.initCallbacks.clear();
13570
13614
  this.hierarchyObservers.forEach((o) => o(hierarchy));
13571
13615
  }
13572
- calculateHierarchy() {
13573
- const yState = this._yState;
13574
- if (!yState)
13575
- return;
13616
+ calculateHierarchy(yState) {
13576
13617
  const executedTransactionIds = new Set(yState.executedTransactionIds);
13577
13618
  const localActions = this.localActions.filter((a) => a.tId && !executedTransactionIds.has(a.tId));
13578
13619
  this.localActions = localActions;
13579
13620
  const { pages, groups } = applyActionsLocally(this.designSystemVersionId, yState, localActions);
13580
- const hierarchy = computeDocsHierarchy({
13581
- pages,
13582
- groups,
13583
- approvals: yState.approvals,
13584
- groupSnapshots: yState.groupSnapshots,
13585
- pageContentHashes: yState.pageContentHashes,
13586
- pageSnapshots: yState.pageSnapshots,
13587
- settings: yState.settings,
13588
- pageLiveblockRoomIds: yState.pageLiveblockRoomIds
13589
- });
13621
+ const hierarchy = computeDocsHierarchy(
13622
+ {
13623
+ pages,
13624
+ groups,
13625
+ approvals: yState.approvals,
13626
+ groupSnapshots: yState.groupSnapshots,
13627
+ pageContentHashes: yState.pageContentHashes,
13628
+ pageSnapshots: yState.pageSnapshots,
13629
+ settings: yState.settings,
13630
+ pageLiveblockRoomIds: yState.pageLiveblockRoomIds
13631
+ },
13632
+ { includeDeletedContent: true }
13633
+ );
13590
13634
  return hierarchy;
13591
13635
  }
13592
13636
  onYUpdate() {
13593
13637
  const newState = new VersionRoomBaseYDoc(this.yDoc).getState();
13594
13638
  if (newState.groups.length) {
13595
13639
  this._yState = newState;
13596
- this.refreshHierarchy();
13640
+ this.refreshState();
13641
+ this.initCallbacks.forEach((f) => f());
13642
+ this.initCallbacks.clear();
13597
13643
  }
13598
13644
  }
13599
13645
  };
@@ -13746,6 +13792,7 @@ export {
13746
13792
  DTODocumentationPageV2,
13747
13793
  DTODocumentationPublishMetadata,
13748
13794
  DTODocumentationPublishTypeQueryParams,
13795
+ DTODocumentationSettings,
13749
13796
  DTODocumentationStructure,
13750
13797
  DTODocumentationStructureGroupItem,
13751
13798
  DTODocumentationStructureItem,