@supernova-studio/client 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +444 -48
- package/dist/index.d.ts +444 -48
- package/dist/index.js +212 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1366 -1270
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +9 -4
- package/src/api/dto/documentation/index.ts +1 -0
- package/src/api/dto/documentation/link-preview.ts +23 -0
- package/src/api/dto/elements/elements-action-v2.ts +1 -1
- package/src/api/payloads/index.ts +1 -0
- package/src/api/payloads/workspaces/index.ts +1 -0
- package/src/api/payloads/workspaces/workspace-configuration.ts +50 -0
- package/src/yjs/docs-editor/mock.ts +11 -2
- package/src/yjs/docs-editor/prosemirror/schema.ts +20 -42
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -108,6 +108,10 @@ var _zod = require('zod');
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
+
var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr);
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
111
115
|
|
|
112
116
|
|
|
113
117
|
|
|
@@ -334,6 +338,12 @@ var Subscription = _zod.z.object({
|
|
|
334
338
|
billingType: BillingTypeSchema.optional(),
|
|
335
339
|
daysUntilDue: _zod.z.number().optional()
|
|
336
340
|
});
|
|
341
|
+
var AssetDynamoRecord = _zod.z.object({
|
|
342
|
+
path: _zod.z.string(),
|
|
343
|
+
id: _zod.z.string(),
|
|
344
|
+
designSystemId: _zod.z.string(),
|
|
345
|
+
expiresAt: _zod.z.number()
|
|
346
|
+
});
|
|
337
347
|
var AssetReference = _zod.z.object({
|
|
338
348
|
id: _zod.z.string(),
|
|
339
349
|
designSystemVersionId: _zod.z.string(),
|
|
@@ -347,12 +357,19 @@ var AssetFontProperties = _zod.z.object({
|
|
|
347
357
|
family: _zod.z.string(),
|
|
348
358
|
subfamily: _zod.z.string()
|
|
349
359
|
});
|
|
350
|
-
var AssetProperties = _zod.z.
|
|
351
|
-
|
|
352
|
-
|
|
360
|
+
var AssetProperties = _zod.z.union([
|
|
361
|
+
_zod.z.object({
|
|
362
|
+
fontProperties: _zod.z.array(AssetFontProperties)
|
|
363
|
+
}),
|
|
364
|
+
_zod.z.object({
|
|
365
|
+
width: _zod.z.number(),
|
|
366
|
+
height: _zod.z.number()
|
|
367
|
+
})
|
|
368
|
+
]);
|
|
353
369
|
var AssetOrigin = _zod.z.object({
|
|
354
370
|
originKey: _zod.z.string()
|
|
355
371
|
});
|
|
372
|
+
var AssetProcessStatus = _zod.z.enum(["Pending", "Uploaded", "Processed"]);
|
|
356
373
|
var Asset = _zod.z.object({
|
|
357
374
|
id: _zod.z.string(),
|
|
358
375
|
designSystemId: _zod.z.string().nullish(),
|
|
@@ -361,6 +378,7 @@ var Asset = _zod.z.object({
|
|
|
361
378
|
filePath: _zod.z.string(),
|
|
362
379
|
scope: AssetScope,
|
|
363
380
|
properties: AssetProperties.nullish(),
|
|
381
|
+
state: AssetProcessStatus.optional(),
|
|
364
382
|
origin: AssetOrigin.optional(),
|
|
365
383
|
originKey: _zod.z.string().optional()
|
|
366
384
|
});
|
|
@@ -1109,30 +1127,6 @@ var PageBlockItemTableValue = _zod.z.object({
|
|
|
1109
1127
|
showBorder: _zod.z.boolean().optional(),
|
|
1110
1128
|
value: _zod.z.array(PageBlockItemTableRow)
|
|
1111
1129
|
});
|
|
1112
|
-
var RESERVED_OBJECT_ID_PREFIX = "x-sn-reserved-";
|
|
1113
|
-
var SafeIdSchema = _zod.z.string().refine(
|
|
1114
|
-
(value) => {
|
|
1115
|
-
return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);
|
|
1116
|
-
},
|
|
1117
|
-
{
|
|
1118
|
-
message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`
|
|
1119
|
-
}
|
|
1120
|
-
);
|
|
1121
|
-
var DocumentationPageAssetType = _zod.z.enum(["image", "figmaFrame"]);
|
|
1122
|
-
var DocumentationPageImageAsset = _zod.z.object({
|
|
1123
|
-
type: _zod.z.literal(DocumentationPageAssetType.Enum.image),
|
|
1124
|
-
url: _zod.z.string().optional(),
|
|
1125
|
-
id: SafeIdSchema
|
|
1126
|
-
});
|
|
1127
|
-
var DocumentationPageFrameAsset = _zod.z.object({
|
|
1128
|
-
type: _zod.z.literal(DocumentationPageAssetType.Enum.figmaFrame),
|
|
1129
|
-
url: _zod.z.string().optional(),
|
|
1130
|
-
figmaFrame: PageBlockFrame
|
|
1131
|
-
});
|
|
1132
|
-
var DocumentationPageAsset = _zod.z.discriminatedUnion("type", [
|
|
1133
|
-
DocumentationPageImageAsset,
|
|
1134
|
-
DocumentationPageFrameAsset
|
|
1135
|
-
]);
|
|
1136
1130
|
var DocumentationItemHeaderAlignmentSchema = _zod.z.enum(["Left", "Center"]);
|
|
1137
1131
|
var DocumentationItemHeaderImageScaleTypeSchema = _zod.z.enum(["AspectFill", "AspectFit"]);
|
|
1138
1132
|
var DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;
|
|
@@ -1142,7 +1136,7 @@ var DocumentationItemHeaderV1 = _zod.z.object({
|
|
|
1142
1136
|
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
1143
1137
|
foregroundColor: ColorTokenData.nullish(),
|
|
1144
1138
|
backgroundColor: ColorTokenData.nullish(),
|
|
1145
|
-
backgroundImageAsset:
|
|
1139
|
+
backgroundImageAsset: PageBlockAsset.nullish(),
|
|
1146
1140
|
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
1147
1141
|
showBackgroundOverlay: _zod.z.boolean(),
|
|
1148
1142
|
showCoverText: _zod.z.boolean(),
|
|
@@ -1375,6 +1369,15 @@ var ParagraphSpacingValue = _zod.z.object({
|
|
|
1375
1369
|
var ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);
|
|
1376
1370
|
var ProductCopyValue = _zod.z.string();
|
|
1377
1371
|
var ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);
|
|
1372
|
+
var RESERVED_OBJECT_ID_PREFIX = "x-sn-reserved-";
|
|
1373
|
+
var SafeIdSchema = _zod.z.string().refine(
|
|
1374
|
+
(value) => {
|
|
1375
|
+
return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`
|
|
1379
|
+
}
|
|
1380
|
+
);
|
|
1378
1381
|
var ShadowType = _zod.z.enum(["Drop", "Inner"]);
|
|
1379
1382
|
var ShadowLayerValue = _zod.z.object({
|
|
1380
1383
|
color: ColorTokenData,
|
|
@@ -2141,6 +2144,36 @@ var DocumentationPageGroup = _zod.z.object({
|
|
|
2141
2144
|
createdAt: _zod.z.coerce.date(),
|
|
2142
2145
|
updatedAt: _zod.z.coerce.date()
|
|
2143
2146
|
});
|
|
2147
|
+
var DocumentationLinkPreview = _zod.z.object({
|
|
2148
|
+
title: _zod.z.string().optional(),
|
|
2149
|
+
description: _zod.z.string().optional(),
|
|
2150
|
+
thumbnailUrl: _zod.z.string().optional()
|
|
2151
|
+
});
|
|
2152
|
+
var DocumentationPageContentBackup = _zod.z.object({
|
|
2153
|
+
id: _zod.z.string(),
|
|
2154
|
+
designSystemVersionId: _zod.z.string(),
|
|
2155
|
+
createdAt: _zod.z.coerce.date(),
|
|
2156
|
+
updatedAt: _zod.z.coerce.date(),
|
|
2157
|
+
documentationPageId: _zod.z.string(),
|
|
2158
|
+
documentationPageName: _zod.z.string(),
|
|
2159
|
+
storagePath: _zod.z.string()
|
|
2160
|
+
});
|
|
2161
|
+
var DocumentationPageContentItem = _zod.z.discriminatedUnion("type", [
|
|
2162
|
+
PageBlockEditorModelV2,
|
|
2163
|
+
PageSectionEditorModelV2
|
|
2164
|
+
]);
|
|
2165
|
+
var DocumentationPageContentData = _zod.z.object({
|
|
2166
|
+
items: _zod.z.array(DocumentationPageContentItem)
|
|
2167
|
+
});
|
|
2168
|
+
var DocumentationPageContent = _zod.z.object({
|
|
2169
|
+
id: _zod.z.string(),
|
|
2170
|
+
designSystemVersionId: _zod.z.string(),
|
|
2171
|
+
createdAt: _zod.z.coerce.date(),
|
|
2172
|
+
updatedAt: _zod.z.coerce.date(),
|
|
2173
|
+
documentationPageId: _zod.z.string(),
|
|
2174
|
+
data: DocumentationPageContentData,
|
|
2175
|
+
isDirty: _zod.z.boolean()
|
|
2176
|
+
});
|
|
2144
2177
|
var DocumentationPage = _zod.z.object({
|
|
2145
2178
|
type: _zod.z.literal("DocumentationPage"),
|
|
2146
2179
|
id: _zod.z.string(),
|
|
@@ -2155,6 +2188,43 @@ var DocumentationPage = _zod.z.object({
|
|
|
2155
2188
|
createdAt: _zod.z.coerce.date(),
|
|
2156
2189
|
updatedAt: _zod.z.coerce.date()
|
|
2157
2190
|
});
|
|
2191
|
+
var DesignSystemVersionRoom = Entity.extend({
|
|
2192
|
+
designSystemVersionId: _zod.z.string(),
|
|
2193
|
+
liveblocksId: _zod.z.string()
|
|
2194
|
+
});
|
|
2195
|
+
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
2196
|
+
pages: _zod.z.array(DocumentationPageV2),
|
|
2197
|
+
groups: _zod.z.array(ElementGroup)
|
|
2198
|
+
});
|
|
2199
|
+
var DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
2200
|
+
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
2201
|
+
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
2202
|
+
});
|
|
2203
|
+
var DocumentationPageRoom = Entity.extend({
|
|
2204
|
+
designSystemVersionId: _zod.z.string(),
|
|
2205
|
+
documentationPageId: _zod.z.string(),
|
|
2206
|
+
liveblocksId: _zod.z.string(),
|
|
2207
|
+
isDirty: _zod.z.boolean()
|
|
2208
|
+
});
|
|
2209
|
+
var DocumentationPageRoomState = _zod.z.object({
|
|
2210
|
+
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
2211
|
+
itemConfiguration: DocumentationItemConfigurationV2
|
|
2212
|
+
});
|
|
2213
|
+
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
2214
|
+
page: DocumentationPageV2,
|
|
2215
|
+
pageParent: ElementGroup
|
|
2216
|
+
});
|
|
2217
|
+
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
2218
|
+
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
2219
|
+
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
2220
|
+
});
|
|
2221
|
+
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
2222
|
+
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
2223
|
+
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
2224
|
+
return RoomTypeEnum2;
|
|
2225
|
+
})(RoomTypeEnum || {});
|
|
2226
|
+
var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
|
|
2227
|
+
var RoomType = RoomTypeSchema.enum;
|
|
2158
2228
|
var NpmRegistryAuthType = _zod.z.enum(["Basic", "Bearer", "None", "Custom"]);
|
|
2159
2229
|
var NpmRegistryType = _zod.z.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
|
|
2160
2230
|
var NpmRegistryBasicAuthConfig = _zod.z.object({
|
|
@@ -2207,16 +2277,21 @@ var UserInvite = _zod.z.object({
|
|
|
2207
2277
|
role: WorkspaceRoleSchema
|
|
2208
2278
|
});
|
|
2209
2279
|
var UserInvites = _zod.z.array(UserInvite).max(MAX_MEMBERS_COUNT);
|
|
2280
|
+
var isValidCIDR = (value) => {
|
|
2281
|
+
return _ipcidr2.default.isValidAddress(value);
|
|
2282
|
+
};
|
|
2210
2283
|
var WorkspaceIpWhitelistEntry = _zod.z.object({
|
|
2211
2284
|
isEnabled: _zod.z.boolean(),
|
|
2212
2285
|
name: _zod.z.string(),
|
|
2213
|
-
range: _zod.z.string()
|
|
2286
|
+
range: _zod.z.string().refine(isValidCIDR, {
|
|
2287
|
+
message: "Invalid IP CIDR"
|
|
2288
|
+
})
|
|
2214
2289
|
});
|
|
2215
2290
|
var WorkspaceIpSettings = _zod.z.object({
|
|
2216
2291
|
isEnabledForCloud: _zod.z.boolean(),
|
|
2217
2292
|
isEnabledForDocs: _zod.z.boolean(),
|
|
2218
2293
|
entries: _zod.z.array(WorkspaceIpWhitelistEntry)
|
|
2219
|
-
})
|
|
2294
|
+
});
|
|
2220
2295
|
var WorkspaceProfile = _zod.z.object({
|
|
2221
2296
|
name: _zod.z.string(),
|
|
2222
2297
|
handle: _zod.z.string(),
|
|
@@ -2228,9 +2303,9 @@ var Workspace = _zod.z.object({
|
|
|
2228
2303
|
id: _zod.z.string(),
|
|
2229
2304
|
profile: WorkspaceProfile,
|
|
2230
2305
|
subscription: Subscription,
|
|
2231
|
-
ipWhitelist: WorkspaceIpSettings,
|
|
2232
|
-
sso: SsoProvider
|
|
2233
|
-
npmRegistrySettings:
|
|
2306
|
+
ipWhitelist: nullishToOptional(WorkspaceIpSettings),
|
|
2307
|
+
sso: nullishToOptional(SsoProvider),
|
|
2308
|
+
npmRegistrySettings: nullishToOptional(NpmRegistryConfig),
|
|
2234
2309
|
designSystems: _zod.z.array(DesignSystem).nullish()
|
|
2235
2310
|
});
|
|
2236
2311
|
var WorkspaceWithDesignSystems = _zod.z.object({
|
|
@@ -2240,7 +2315,7 @@ var WorkspaceWithDesignSystems = _zod.z.object({
|
|
|
2240
2315
|
var WorkspaceContext = _zod.z.object({
|
|
2241
2316
|
workspaceId: _zod.z.string(),
|
|
2242
2317
|
product: ProductCodeSchema,
|
|
2243
|
-
ipWhitelist: WorkspaceIpSettings,
|
|
2318
|
+
ipWhitelist: nullishToOptional(WorkspaceIpSettings),
|
|
2244
2319
|
publicDesignSystem: _zod.z.boolean().optional()
|
|
2245
2320
|
});
|
|
2246
2321
|
var slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
@@ -2260,7 +2335,10 @@ var CreateWorkspaceInput = _zod.z.object({
|
|
|
2260
2335
|
planInterval: BillingIntervalSchema.optional(),
|
|
2261
2336
|
seats: _zod.z.number().optional(),
|
|
2262
2337
|
seatLimit: _zod.z.number().optional(),
|
|
2263
|
-
card: CardSchema.optional()
|
|
2338
|
+
card: CardSchema.optional(),
|
|
2339
|
+
sso: SsoProvider.optional(),
|
|
2340
|
+
npmRegistrySettings: NpmRegistryConfig.optional(),
|
|
2341
|
+
ipWhitelist: WorkspaceIpSettings.optional()
|
|
2264
2342
|
});
|
|
2265
2343
|
var WorkspaceInvitation = _zod.z.object({
|
|
2266
2344
|
id: _zod.z.string(),
|
|
@@ -2525,9 +2603,9 @@ var PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({
|
|
|
2525
2603
|
var PulsarContributionVariant = _zod.z.object({
|
|
2526
2604
|
key: _zod.z.string(),
|
|
2527
2605
|
name: _zod.z.string(),
|
|
2528
|
-
isDefault: _zod.z.boolean()
|
|
2529
|
-
description: _zod.z.string()
|
|
2530
|
-
thumbnailURL: _zod.z.string()
|
|
2606
|
+
isDefault: nullishToOptional(_zod.z.boolean()),
|
|
2607
|
+
description: nullishToOptional(_zod.z.string()),
|
|
2608
|
+
thumbnailURL: nullishToOptional(_zod.z.string())
|
|
2531
2609
|
});
|
|
2532
2610
|
var PulsarCustomBlock = _zod.z.object({
|
|
2533
2611
|
title: _zod.z.string(),
|
|
@@ -2693,38 +2771,6 @@ var IntegrationTokenSchema = _zod.z.object({
|
|
|
2693
2771
|
expiresAt: _zod.z.coerce.date(),
|
|
2694
2772
|
externalUserId: _zod.z.string().nullish()
|
|
2695
2773
|
});
|
|
2696
|
-
var DesignSystemVersionRoom = Entity.extend({
|
|
2697
|
-
designSystemVersionId: _zod.z.string(),
|
|
2698
|
-
liveblocksId: _zod.z.string()
|
|
2699
|
-
});
|
|
2700
|
-
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
2701
|
-
pages: _zod.z.array(DocumentationPageV2),
|
|
2702
|
-
groups: _zod.z.array(ElementGroup)
|
|
2703
|
-
});
|
|
2704
|
-
var DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
2705
|
-
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
2706
|
-
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
2707
|
-
});
|
|
2708
|
-
var DocumentationPageRoom = Entity.extend({
|
|
2709
|
-
designSystemVersionId: _zod.z.string(),
|
|
2710
|
-
documentationPageId: _zod.z.string(),
|
|
2711
|
-
liveblocksId: _zod.z.string()
|
|
2712
|
-
});
|
|
2713
|
-
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
2714
|
-
page: DocumentationPageV2,
|
|
2715
|
-
pageParent: ElementGroup
|
|
2716
|
-
});
|
|
2717
|
-
var DocumentationPageRoomInitialState = DocumentationPageRoomRoomUpdate.extend({
|
|
2718
|
-
pageBlocks: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
2719
|
-
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
2720
|
-
});
|
|
2721
|
-
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
2722
|
-
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
2723
|
-
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
2724
|
-
return RoomTypeEnum2;
|
|
2725
|
-
})(RoomTypeEnum || {});
|
|
2726
|
-
var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
|
|
2727
|
-
var RoomType = RoomTypeSchema.enum;
|
|
2728
2774
|
var AnyRecord = _zod.z.record(_zod.z.any());
|
|
2729
2775
|
var NpmPackageVersionDist = AnyRecord.and(
|
|
2730
2776
|
_zod.z.object({
|
|
@@ -3658,6 +3704,16 @@ var DTODesignSystem = DesignSystem.omit({
|
|
|
3658
3704
|
meta: ObjectMeta
|
|
3659
3705
|
});
|
|
3660
3706
|
|
|
3707
|
+
// src/api/dto/documentation/link-preview.ts
|
|
3708
|
+
|
|
3709
|
+
var DTODocumentationLinkPreviewResponse = _zod.z.object({
|
|
3710
|
+
linkPreview: DocumentationLinkPreview
|
|
3711
|
+
});
|
|
3712
|
+
var DTODocumentationLinkPreviewRequest = _zod.z.object({
|
|
3713
|
+
url: _zod.z.string().optional(),
|
|
3714
|
+
documentationItemPersistentId: _zod.z.string().optional()
|
|
3715
|
+
});
|
|
3716
|
+
|
|
3661
3717
|
// src/api/dto/elements/documentation/group-action.ts
|
|
3662
3718
|
|
|
3663
3719
|
|
|
@@ -3966,7 +4022,7 @@ var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
|
3966
4022
|
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3967
4023
|
DTODocumentationGroupDeleteActionOutputV2,
|
|
3968
4024
|
DTODocumentationTabGroupDeleteActionOutputV2,
|
|
3969
|
-
//
|
|
4025
|
+
// Figma frames
|
|
3970
4026
|
DTOFigmaNodeRenderActionOutput
|
|
3971
4027
|
]);
|
|
3972
4028
|
var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
@@ -4061,6 +4117,51 @@ var DTOLiveblocksAuthRequest = _zod.z.object({
|
|
|
4061
4117
|
room: _zod.z.string()
|
|
4062
4118
|
});
|
|
4063
4119
|
|
|
4120
|
+
// src/api/payloads/workspaces/workspace-configuration.ts
|
|
4121
|
+
|
|
4122
|
+
var prohibitedSsoKeys = ["providerId", "metadataXml", "emailDomains"];
|
|
4123
|
+
function validateSsoPayload(ssoPayload) {
|
|
4124
|
+
const keys = [];
|
|
4125
|
+
let valid = true;
|
|
4126
|
+
if (!ssoPayload) {
|
|
4127
|
+
valid = true;
|
|
4128
|
+
return {
|
|
4129
|
+
valid,
|
|
4130
|
+
keys: []
|
|
4131
|
+
};
|
|
4132
|
+
}
|
|
4133
|
+
for (const key of Object.keys(ssoPayload)) {
|
|
4134
|
+
if (prohibitedSsoKeys.includes(key)) {
|
|
4135
|
+
keys.push(key);
|
|
4136
|
+
valid = false;
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
return {
|
|
4140
|
+
valid,
|
|
4141
|
+
keys
|
|
4142
|
+
};
|
|
4143
|
+
}
|
|
4144
|
+
var NpmRegistryInput = _zod.z.object({
|
|
4145
|
+
enabledScopes: _zod.z.array(_zod.z.string()),
|
|
4146
|
+
customRegistryUrl: _zod.z.string().optional(),
|
|
4147
|
+
bypassProxy: _zod.z.boolean().optional(),
|
|
4148
|
+
npmProxyRegistryConfigId: _zod.z.string().optional(),
|
|
4149
|
+
npmProxyVersion: _zod.z.number().optional(),
|
|
4150
|
+
registryType: _zod.z.string(),
|
|
4151
|
+
authType: _zod.z.string(),
|
|
4152
|
+
authHeaderName: _zod.z.string(),
|
|
4153
|
+
authHeaderValue: _zod.z.string(),
|
|
4154
|
+
accessToken: _zod.z.string(),
|
|
4155
|
+
username: _zod.z.string(),
|
|
4156
|
+
password: _zod.z.string()
|
|
4157
|
+
});
|
|
4158
|
+
var WorkspaceConfigurationPayload = _zod.z.object({
|
|
4159
|
+
ipWhitelist: WorkspaceIpSettings.partial().optional(),
|
|
4160
|
+
sso: SsoProvider.partial().optional(),
|
|
4161
|
+
npmRegistrySettings: NpmRegistryInput.partial().optional(),
|
|
4162
|
+
profile: WorkspaceProfile.partial().optional()
|
|
4163
|
+
});
|
|
4164
|
+
|
|
4064
4165
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
4065
4166
|
function documentationHierarchyToYjs(doc, transaction) {
|
|
4066
4167
|
doc.transact((trx) => {
|
|
@@ -4655,56 +4756,34 @@ var newSchema = {
|
|
|
4655
4756
|
}
|
|
4656
4757
|
},
|
|
4657
4758
|
image: {
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
inline: false,
|
|
4662
|
-
draggable: true,
|
|
4663
|
-
attrs: {
|
|
4664
|
-
src: {
|
|
4665
|
-
default: null
|
|
4666
|
-
},
|
|
4667
|
-
alt: {
|
|
4668
|
-
default: null
|
|
4669
|
-
},
|
|
4670
|
-
title: {
|
|
4671
|
-
default: null
|
|
4672
|
-
}
|
|
4673
|
-
},
|
|
4674
|
-
parseDOM: [
|
|
4675
|
-
{
|
|
4676
|
-
tag: 'img[src]:not([src^="data:"])'
|
|
4677
|
-
}
|
|
4678
|
-
]
|
|
4679
|
-
},
|
|
4680
|
-
markSet: [],
|
|
4681
|
-
groups: ["block"],
|
|
4759
|
+
group: "block",
|
|
4760
|
+
atom: true,
|
|
4761
|
+
draggable: true,
|
|
4682
4762
|
attrs: {
|
|
4683
|
-
|
|
4684
|
-
hasDefault: true,
|
|
4763
|
+
id: {
|
|
4685
4764
|
default: null
|
|
4686
4765
|
},
|
|
4687
|
-
|
|
4688
|
-
hasDefault: true,
|
|
4766
|
+
definitionId: {
|
|
4689
4767
|
default: null
|
|
4690
4768
|
},
|
|
4691
|
-
|
|
4692
|
-
hasDefault: true,
|
|
4769
|
+
variantId: {
|
|
4693
4770
|
default: null
|
|
4771
|
+
},
|
|
4772
|
+
appearance: {
|
|
4773
|
+
default: "{}"
|
|
4774
|
+
},
|
|
4775
|
+
columns: {
|
|
4776
|
+
default: 1
|
|
4777
|
+
},
|
|
4778
|
+
items: {
|
|
4779
|
+
default: "[]"
|
|
4694
4780
|
}
|
|
4695
4781
|
},
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
contentMatch: {
|
|
4702
|
-
validEnd: true,
|
|
4703
|
-
wrapCache: []
|
|
4704
|
-
},
|
|
4705
|
-
inlineContent: false,
|
|
4706
|
-
isBlock: true,
|
|
4707
|
-
isText: false
|
|
4782
|
+
parseDOM: [
|
|
4783
|
+
{
|
|
4784
|
+
tag: "block-node"
|
|
4785
|
+
}
|
|
4786
|
+
]
|
|
4708
4787
|
}
|
|
4709
4788
|
},
|
|
4710
4789
|
marks: {
|
|
@@ -5407,7 +5486,16 @@ function nonNullFilter(item) {
|
|
|
5407
5486
|
|
|
5408
5487
|
// src/yjs/docs-editor/mock.ts
|
|
5409
5488
|
function getMockPageBlockDefinitions() {
|
|
5410
|
-
return blocks
|
|
5489
|
+
return blocks.map((block) => {
|
|
5490
|
+
return {
|
|
5491
|
+
...block,
|
|
5492
|
+
item: {
|
|
5493
|
+
...block.item,
|
|
5494
|
+
// Make sure variatns array is copied
|
|
5495
|
+
variants: [...block.item.variants]
|
|
5496
|
+
}
|
|
5497
|
+
};
|
|
5498
|
+
});
|
|
5411
5499
|
}
|
|
5412
5500
|
var blocks = [
|
|
5413
5501
|
{
|
|
@@ -8026,11 +8114,14 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap) {
|
|
|
8026
8114
|
}).filter(nonNullFilter2);
|
|
8027
8115
|
}
|
|
8028
8116
|
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap) {
|
|
8029
|
-
|
|
8117
|
+
let definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", _zod.z.string());
|
|
8030
8118
|
if (!definitionId) {
|
|
8031
8119
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
8032
8120
|
return null;
|
|
8033
8121
|
}
|
|
8122
|
+
if (definitionId === "io.supernova.block.token-detail") {
|
|
8123
|
+
definitionId = "io.supernova.block.token-list";
|
|
8124
|
+
}
|
|
8034
8125
|
const definition = definitionsMap.get(definitionId);
|
|
8035
8126
|
if (!definition) {
|
|
8036
8127
|
console.warn(
|
|
@@ -8623,5 +8714,10 @@ function mapByUnique2(items, keyFn) {
|
|
|
8623
8714
|
|
|
8624
8715
|
|
|
8625
8716
|
|
|
8626
|
-
|
|
8717
|
+
|
|
8718
|
+
|
|
8719
|
+
|
|
8720
|
+
|
|
8721
|
+
|
|
8722
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTOCreateDocumentationTabInput = DTOCreateDocumentationTabInput; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODeleteDocumentationTabGroupInput = DTODeleteDocumentationTabGroupInput; exports.DTODesignSystem = DTODesignSystem; 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.DTODocumentationGroupStructureV2 = DTODocumentationGroupStructureV2; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationGroupV2 = DTODocumentationGroupV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationLinkPreviewRequest = DTODocumentationLinkPreviewRequest; exports.DTODocumentationLinkPreviewResponse = DTODocumentationLinkPreviewResponse; 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.DTODocumentationPageRoomHeaderData = DTODocumentationPageRoomHeaderData; exports.DTODocumentationPageRoomHeaderDataUpdate = DTODocumentationPageRoomHeaderDataUpdate; exports.DTODocumentationPageStructureV2 = DTODocumentationPageStructureV2; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODocumentationTabCreateActionInputV2 = DTODocumentationTabCreateActionInputV2; exports.DTODocumentationTabCreateActionOutputV2 = DTODocumentationTabCreateActionOutputV2; exports.DTODocumentationTabGroupDeleteActionInputV2 = DTODocumentationTabGroupDeleteActionInputV2; exports.DTODocumentationTabGroupDeleteActionOutputV2 = DTODocumentationTabGroupDeleteActionOutputV2; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOElementsGetOutput = DTOElementsGetOutput; exports.DTOElementsGetQuerySchema = DTOElementsGetQuerySchema; exports.DTOElementsGetTypeFilter = DTOElementsGetTypeFilter; exports.DTOFigmaNode = DTOFigmaNode; exports.DTOFigmaNodeData = DTOFigmaNodeData; exports.DTOFigmaNodeRenderActionInput = DTOFigmaNodeRenderActionInput; exports.DTOFigmaNodeRenderActionOutput = DTOFigmaNodeRenderActionOutput; exports.DTOFigmaNodeRenderInput = DTOFigmaNodeRenderInput; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOMoveDocumentationGroupInput = DTOMoveDocumentationGroupInput; exports.DTOMoveDocumentationPageInputV2 = DTOMoveDocumentationPageInputV2; exports.DTONpmRegistryConfig = DTONpmRegistryConfig; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DTOUserWorkspaceMembership = DTOUserWorkspaceMembership; exports.DTOUserWorkspaceMembershipsResponse = DTOUserWorkspaceMembershipsResponse; exports.DTOWorkspace = DTOWorkspace; exports.DTOWorkspaceRole = DTOWorkspaceRole; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.NpmRegistryInput = NpmRegistryInput; exports.PageBlockEditorModel = PageBlockEditorModel; exports.PageSectionEditorModel = PageSectionEditorModel; exports.WorkspaceConfigurationPayload = WorkspaceConfigurationPayload; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.documentationElementsToHierarchyDto = documentationElementsToHierarchyDto; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.documentationPagesToStructureDTOV2 = documentationPagesToStructureDTOV2; exports.elementGroupsToDocumentationGroupDTO = elementGroupsToDocumentationGroupDTO; exports.elementGroupsToDocumentationGroupStructureDTO = elementGroupsToDocumentationGroupStructureDTO; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pmSchema = pmSchema; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorNodeToBlock = prosemirrorNodeToBlock; exports.prosemirrorNodeToSection = prosemirrorNodeToSection; exports.prosemirrorNodesToBlocks = prosemirrorNodesToBlocks; exports.sectionToProsemirrorNode = sectionToProsemirrorNode; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.validateSsoPayload = validateSsoPayload; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
|
|
8627
8723
|
//# sourceMappingURL=index.js.map
|