@supernova-studio/client 0.9.3 → 0.10.1
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 +161 -260
- package/dist/index.d.ts +161 -260
- package/dist/index.js +244 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +232 -67
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/design-system.ts +11 -0
- package/src/api/dto/index.ts +1 -0
- package/src/docs-editor/blocks-to-prosemirror.ts +8 -4
- package/src/docs-editor/mock.ts +2 -1374
- package/src/docs-editor/prosemirror-to-blocks.ts +3 -0
package/dist/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }//
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../model/dist/index.mjs
|
|
2
2
|
var _zod = require('zod');
|
|
3
3
|
|
|
4
|
-
// ../model/dist/index.mjs
|
|
5
|
-
|
|
6
|
-
|
|
7
4
|
|
|
8
5
|
|
|
9
6
|
|
|
@@ -880,7 +877,7 @@ var PageBlockV1 = PageBlockBaseV1.extend({
|
|
|
880
877
|
)
|
|
881
878
|
});
|
|
882
879
|
var PageBlockLinkType = _zod.z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
883
|
-
var PageBlockImageType = _zod.z.enum(["Upload", "Asset", "
|
|
880
|
+
var PageBlockImageType = _zod.z.enum(["Upload", "Asset", "FigmaNode"]);
|
|
884
881
|
var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
885
882
|
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
886
883
|
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
@@ -979,6 +976,21 @@ var PageBlockItemEmbedValue = _zod.z.object({
|
|
|
979
976
|
caption: _zod.z.string().optional(),
|
|
980
977
|
height: _zod.z.number().optional()
|
|
981
978
|
});
|
|
979
|
+
var PageBlockItemFigmaNodeValue = _zod.z.object({
|
|
980
|
+
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
981
|
+
showSearch: _zod.z.boolean().optional(),
|
|
982
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
983
|
+
backgroundColor: _zod.z.string().optional(),
|
|
984
|
+
value: _zod.z.array(
|
|
985
|
+
_zod.z.object({
|
|
986
|
+
entityId: _zod.z.string(),
|
|
987
|
+
entityMeta: _zod.z.object({
|
|
988
|
+
title: _zod.z.string().optional(),
|
|
989
|
+
description: _zod.z.string().optional()
|
|
990
|
+
}).optional()
|
|
991
|
+
})
|
|
992
|
+
)
|
|
993
|
+
});
|
|
982
994
|
var PageBlockItemImageValue = _zod.z.object({
|
|
983
995
|
alt: _zod.z.string().optional(),
|
|
984
996
|
caption: _zod.z.string().optional(),
|
|
@@ -1864,6 +1876,7 @@ var PageBlockDefinitionPropertyType = _zod.z.enum([
|
|
|
1864
1876
|
"ComponentProperty",
|
|
1865
1877
|
"Asset",
|
|
1866
1878
|
"AssetProperty",
|
|
1879
|
+
"FigmaNode",
|
|
1867
1880
|
"EmbedURL",
|
|
1868
1881
|
"URL",
|
|
1869
1882
|
"Markdown",
|
|
@@ -1898,6 +1911,7 @@ var PageBlockDefinitionTextPropertyStyle = _zod.z.enum([
|
|
|
1898
1911
|
"SmallBold",
|
|
1899
1912
|
"SmallSemibold"
|
|
1900
1913
|
]);
|
|
1914
|
+
var PageBlockDefinitionTextPropertyColor = _zod.z.enum(["Neutral", "NeutralFaded"]);
|
|
1901
1915
|
var PageBlockDefinitionBooleanPropertyStyle = _zod.z.enum(["SegmentedControl", "ToggleButton", "Checkbox"]);
|
|
1902
1916
|
var PageBlockDefinitionSingleSelectPropertyStyle = _zod.z.enum([
|
|
1903
1917
|
"SegmentedControl",
|
|
@@ -1906,20 +1920,60 @@ var PageBlockDefinitionSingleSelectPropertyStyle = _zod.z.enum([
|
|
|
1906
1920
|
"Checkbox"
|
|
1907
1921
|
]);
|
|
1908
1922
|
var PageBlockDefinitionMultiSelectPropertyStyle = _zod.z.enum(["SegmentedControl", "Select", "Checkbox"]);
|
|
1909
|
-
var
|
|
1910
|
-
|
|
1911
|
-
|
|
1923
|
+
var PageBlockDefinitionImageAspectRatio = _zod.z.enum(["Auto", "Square", "Landscape", "Portrait", "Wide"]);
|
|
1924
|
+
var PageBlockDefinitionImageWidth = _zod.z.enum(["Full", "Icon", "Small", "Medium", "Large", "Poster"]);
|
|
1925
|
+
var PageBlockDefinitionSelectChoice = _zod.z.object({
|
|
1926
|
+
value: _zod.z.string(),
|
|
1927
|
+
name: _zod.z.string(),
|
|
1928
|
+
icon: _zod.z.string().optional()
|
|
1929
|
+
});
|
|
1930
|
+
var PageBlockDefinitionUntypedPropertyOptions = _zod.z.record(_zod.z.any());
|
|
1931
|
+
var PageBlockDefinitionRichTextOptions = _zod.z.object({
|
|
1932
|
+
richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional()
|
|
1933
|
+
});
|
|
1934
|
+
var PageBlockDefinitionMutiRichTextOptions = _zod.z.object({
|
|
1935
|
+
multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional()
|
|
1936
|
+
});
|
|
1937
|
+
var PageBlockDefinitionTextOptions = _zod.z.object({
|
|
1938
|
+
placeholder: _zod.z.string().optional(),
|
|
1939
|
+
defaultValue: _zod.z.string().optional(),
|
|
1912
1940
|
textStyle: PageBlockDefinitionTextPropertyStyle.optional(),
|
|
1941
|
+
color: PageBlockDefinitionTextPropertyColor.optional()
|
|
1942
|
+
});
|
|
1943
|
+
var PageBlockDefinitionSelectOptions = _zod.z.object({
|
|
1944
|
+
singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),
|
|
1945
|
+
defaultChoice: _zod.z.string(),
|
|
1946
|
+
choices: _zod.z.array(PageBlockDefinitionSelectChoice)
|
|
1947
|
+
});
|
|
1948
|
+
var PageBlockDefinitionImageOptions = _zod.z.object({
|
|
1949
|
+
width: PageBlockDefinitionImageWidth.optional(),
|
|
1950
|
+
aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),
|
|
1951
|
+
allowCaption: _zod.z.boolean().optional(),
|
|
1952
|
+
recommendation: _zod.z.string().optional()
|
|
1953
|
+
});
|
|
1954
|
+
var PageBlockDefinitionBooleanOptions = _zod.z.object({
|
|
1955
|
+
defaultvalue: _zod.z.boolean().optional(),
|
|
1956
|
+
booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional()
|
|
1957
|
+
});
|
|
1958
|
+
var PageBlockDefinitionNumberOptions = _zod.z.object({
|
|
1959
|
+
defaultValue: _zod.z.number(),
|
|
1960
|
+
min: _zod.z.number().optional(),
|
|
1961
|
+
max: _zod.z.number().optional(),
|
|
1962
|
+
step: _zod.z.number().optional(),
|
|
1913
1963
|
placeholder: _zod.z.string().optional()
|
|
1914
|
-
})
|
|
1964
|
+
});
|
|
1965
|
+
var PageBlockDefinitionComponentOptions = _zod.z.object({
|
|
1966
|
+
renderLayoutAs: _zod.z.enum(["List", "Table"]).optional(),
|
|
1967
|
+
allowPropertySelection: _zod.z.boolean().optional()
|
|
1968
|
+
});
|
|
1915
1969
|
var PageBlockDefinitionProperty = _zod.z.object({
|
|
1916
1970
|
id: _zod.z.string(),
|
|
1917
1971
|
name: _zod.z.string(),
|
|
1918
1972
|
type: PageBlockDefinitionPropertyType,
|
|
1919
1973
|
description: _zod.z.string().optional(),
|
|
1920
1974
|
// TODO Docs
|
|
1921
|
-
options:
|
|
1922
|
-
variantOptions: _zod.z.record(
|
|
1975
|
+
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
1976
|
+
variantOptions: _zod.z.record(PageBlockDefinitionUntypedPropertyOptions).optional()
|
|
1923
1977
|
});
|
|
1924
1978
|
var PageBlockDefinitionItem = _zod.z.object({
|
|
1925
1979
|
properties: _zod.z.array(PageBlockDefinitionProperty),
|
|
@@ -1941,7 +1995,7 @@ var PageBlockCategory = _zod.z.enum([
|
|
|
1941
1995
|
"Data",
|
|
1942
1996
|
"Other"
|
|
1943
1997
|
]);
|
|
1944
|
-
var PageBlockBehaviorDataType = _zod.z.enum(["Item", "Token", "Asset", "Component", "
|
|
1998
|
+
var PageBlockBehaviorDataType = _zod.z.enum(["Item", "Token", "Asset", "Component", "FigmaNode"]);
|
|
1945
1999
|
var PageBlockBehaviorSelectionType = _zod.z.enum(["Entity", "Group", "EntityAndGroup"]);
|
|
1946
2000
|
var PageBlockDefinitionBehavior = _zod.z.object({
|
|
1947
2001
|
dataType: PageBlockBehaviorDataType,
|
|
@@ -2134,22 +2188,22 @@ var UpdateMembershipRolesInput = _zod.z.object({
|
|
|
2134
2188
|
});
|
|
2135
2189
|
var DesignSystemSwitcher = _zod.z.object({
|
|
2136
2190
|
isEnabled: _zod.z.boolean(),
|
|
2137
|
-
designSystemIds: _zod.z.string()
|
|
2191
|
+
designSystemIds: _zod.z.array(_zod.z.string())
|
|
2138
2192
|
});
|
|
2139
2193
|
var DesignSystem = _zod.z.object({
|
|
2140
2194
|
id: _zod.z.string(),
|
|
2141
2195
|
workspaceId: _zod.z.string(),
|
|
2142
2196
|
name: _zod.z.string(),
|
|
2143
2197
|
description: _zod.z.string(),
|
|
2144
|
-
docExporterId: _zod.z.string()
|
|
2198
|
+
docExporterId: nullishToOptional(_zod.z.string()),
|
|
2145
2199
|
docSlug: _zod.z.string(),
|
|
2146
|
-
docUserSlug: _zod.z.string()
|
|
2200
|
+
docUserSlug: nullishToOptional(_zod.z.string()),
|
|
2147
2201
|
docSlugDeprecated: _zod.z.string(),
|
|
2148
2202
|
isPublic: _zod.z.boolean(),
|
|
2149
2203
|
isMultibrand: _zod.z.boolean(),
|
|
2150
|
-
docViewUrl: _zod.z.string()
|
|
2204
|
+
docViewUrl: nullishToOptional(_zod.z.string()),
|
|
2151
2205
|
basePrefixes: _zod.z.array(_zod.z.string()),
|
|
2152
|
-
designSystemSwitcher: DesignSystemSwitcher
|
|
2206
|
+
designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
|
|
2153
2207
|
createdAt: _zod.z.date(),
|
|
2154
2208
|
updatedAt: _zod.z.date()
|
|
2155
2209
|
});
|
|
@@ -2212,25 +2266,120 @@ var PublishedDoc = _zod.z.object({
|
|
|
2212
2266
|
usesLocalizations: _zod.z.boolean(),
|
|
2213
2267
|
wasPublishedWithLocalizations: _zod.z.boolean()
|
|
2214
2268
|
});
|
|
2215
|
-
var
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
_zod.z.
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
status: ExportJobStatus,
|
|
2227
|
-
docsUrl: _zod.z.string().nullish(),
|
|
2228
|
-
scheduleId: _zod.z.string().nullish(),
|
|
2229
|
-
exporterId: _zod.z.string().nullish(),
|
|
2230
|
-
createdAt: _zod.z.date(),
|
|
2231
|
-
environment: PublishedDocEnvironment,
|
|
2232
|
-
finishedAt: _zod.z.date().nullish()
|
|
2269
|
+
var ExporterJobDestination = _zod.z.enum(["s3", "webhookUrl", "github", "documentation", "azure", "gitlab"]);
|
|
2270
|
+
var ExporterJobStatus = _zod.z.enum(["InProgress", "Success", "Failed", "Timeout"]);
|
|
2271
|
+
var ExporterJobLogEntryType = _zod.z.enum(["success", "info", "warning", "error", "user"]);
|
|
2272
|
+
var ExporterJobLogEntry = _zod.z.object({
|
|
2273
|
+
id: _zod.z.string().optional(),
|
|
2274
|
+
time: _zod.z.coerce.date(),
|
|
2275
|
+
type: ExporterJobLogEntryType,
|
|
2276
|
+
message: _zod.z.string()
|
|
2277
|
+
});
|
|
2278
|
+
var ExporterJobResultPullRequestDestination = _zod.z.object({
|
|
2279
|
+
pullRequestUrl: _zod.z.string()
|
|
2233
2280
|
});
|
|
2281
|
+
var ExporterJobResultS3Destination = _zod.z.object({
|
|
2282
|
+
bucket: _zod.z.string(),
|
|
2283
|
+
urlPrefix: _zod.z.string().optional(),
|
|
2284
|
+
path: _zod.z.string(),
|
|
2285
|
+
files: _zod.z.array(_zod.z.string())
|
|
2286
|
+
});
|
|
2287
|
+
var ExporterJobResultDocsDestination = _zod.z.object({
|
|
2288
|
+
url: _zod.z.string()
|
|
2289
|
+
});
|
|
2290
|
+
var ExporterJobResult = _zod.z.object({
|
|
2291
|
+
error: _zod.z.string().optional(),
|
|
2292
|
+
logs: _zod.z.array(ExporterJobLogEntry).optional(),
|
|
2293
|
+
s3: ExporterJobResultS3Destination.optional(),
|
|
2294
|
+
github: ExporterJobResultPullRequestDestination.optional(),
|
|
2295
|
+
azure: ExporterJobResultPullRequestDestination.optional(),
|
|
2296
|
+
gitlab: ExporterJobResultPullRequestDestination.optional(),
|
|
2297
|
+
bitbucket: ExporterJobResultPullRequestDestination.optional(),
|
|
2298
|
+
sndocs: ExporterJobResultDocsDestination.optional()
|
|
2299
|
+
});
|
|
2300
|
+
var ExporterDestinationSnDocs = _zod.z.object({
|
|
2301
|
+
environment: PublishedDocEnvironment
|
|
2302
|
+
});
|
|
2303
|
+
var ExporterDestinationS3 = _zod.z.object({});
|
|
2304
|
+
var ExporterDestinationGithub = _zod.z.object({
|
|
2305
|
+
connectionId: _zod.z.string(),
|
|
2306
|
+
url: _zod.z.string(),
|
|
2307
|
+
branch: _zod.z.string(),
|
|
2308
|
+
relativePath: _zod.z.string(),
|
|
2309
|
+
// +
|
|
2310
|
+
userId: _zod.z.coerce.string()
|
|
2311
|
+
});
|
|
2312
|
+
var ExporterDestinationAzure = _zod.z.object({
|
|
2313
|
+
connectionId: _zod.z.string(),
|
|
2314
|
+
organizationId: _zod.z.string(),
|
|
2315
|
+
projectId: _zod.z.string(),
|
|
2316
|
+
repositoryId: _zod.z.string(),
|
|
2317
|
+
branch: _zod.z.string(),
|
|
2318
|
+
relativePath: _zod.z.string(),
|
|
2319
|
+
// +
|
|
2320
|
+
userId: _zod.z.coerce.string(),
|
|
2321
|
+
url: _zod.z.string()
|
|
2322
|
+
});
|
|
2323
|
+
var ExporterDestinationGitlab = _zod.z.object({
|
|
2324
|
+
connectionId: _zod.z.string(),
|
|
2325
|
+
projectId: _zod.z.string(),
|
|
2326
|
+
branch: _zod.z.string(),
|
|
2327
|
+
relativePath: _zod.z.string(),
|
|
2328
|
+
// +
|
|
2329
|
+
userId: _zod.z.coerce.string(),
|
|
2330
|
+
url: _zod.z.string()
|
|
2331
|
+
});
|
|
2332
|
+
var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
|
|
2333
|
+
var BITBUCKET_MAX_LENGTH = 64;
|
|
2334
|
+
var ExporterDestinationBitbucket = _zod.z.object({
|
|
2335
|
+
connectionId: _zod.z.string(),
|
|
2336
|
+
workspaceSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
2337
|
+
projectKey: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
2338
|
+
repoSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
2339
|
+
branch: _zod.z.string(),
|
|
2340
|
+
relativePath: _zod.z.string(),
|
|
2341
|
+
// +
|
|
2342
|
+
userId: _zod.z.coerce.string(),
|
|
2343
|
+
url: _zod.z.string()
|
|
2344
|
+
});
|
|
2345
|
+
var ExporterJob = _zod.z.object({
|
|
2346
|
+
id: _zod.z.coerce.string(),
|
|
2347
|
+
createdAt: _zod.z.coerce.date(),
|
|
2348
|
+
finishedAt: _zod.z.coerce.date().optional(),
|
|
2349
|
+
designSystemId: _zod.z.coerce.string(),
|
|
2350
|
+
designSystemVersionId: _zod.z.coerce.string(),
|
|
2351
|
+
workspaceId: _zod.z.coerce.string(),
|
|
2352
|
+
scheduleId: _zod.z.coerce.string().nullish(),
|
|
2353
|
+
exporterId: _zod.z.coerce.string(),
|
|
2354
|
+
brandId: _zod.z.coerce.string().optional(),
|
|
2355
|
+
themeId: _zod.z.coerce.string().optional(),
|
|
2356
|
+
estimatedExecutionTime: _zod.z.number().optional(),
|
|
2357
|
+
status: ExporterJobStatus,
|
|
2358
|
+
result: ExporterJobResult.optional(),
|
|
2359
|
+
createdByUserId: _zod.z.string().optional(),
|
|
2360
|
+
// CodegenDestinationsModel
|
|
2361
|
+
webhookUrl: _zod.z.string().optional(),
|
|
2362
|
+
destinationSnDocs: ExporterDestinationSnDocs.optional(),
|
|
2363
|
+
destinationS3: ExporterDestinationS3.optional(),
|
|
2364
|
+
destinationGithub: ExporterDestinationGithub.optional(),
|
|
2365
|
+
destinationAzure: ExporterDestinationAzure.optional(),
|
|
2366
|
+
destinationGitlab: ExporterDestinationGitlab.optional(),
|
|
2367
|
+
destinationBitbucket: ExporterDestinationBitbucket.optional()
|
|
2368
|
+
});
|
|
2369
|
+
var ExporterJobFindByFilter = ExporterJob.pick({
|
|
2370
|
+
exporterId: true,
|
|
2371
|
+
designSystemVersionId: true,
|
|
2372
|
+
destinations: true,
|
|
2373
|
+
createdByUserId: true,
|
|
2374
|
+
status: true,
|
|
2375
|
+
scheduleId: true,
|
|
2376
|
+
designSystemId: true,
|
|
2377
|
+
themeId: true,
|
|
2378
|
+
brandId: true
|
|
2379
|
+
}).extend({
|
|
2380
|
+
destinations: _zod.z.array(ExporterJobDestination),
|
|
2381
|
+
docsEnvironment: PublishedDocEnvironment
|
|
2382
|
+
}).partial();
|
|
2234
2383
|
var ExporterWorkspaceMembershipRole = _zod.z.enum(["Owner", "OwnerArchived", "User"]);
|
|
2235
2384
|
var ExporterWorkspaceMembership = _zod.z.object({
|
|
2236
2385
|
id: _zod.z.string(),
|
|
@@ -2246,13 +2395,6 @@ var GitProviderNames = /* @__PURE__ */ ((GitProviderNames2) => {
|
|
|
2246
2395
|
return GitProviderNames2;
|
|
2247
2396
|
})(GitProviderNames || {});
|
|
2248
2397
|
var GitProvider = _zod.z.nativeEnum(GitProviderNames);
|
|
2249
|
-
var PulsarContributionVariant = _zod.z.object({
|
|
2250
|
-
key: _zod.z.string(),
|
|
2251
|
-
name: _zod.z.string(),
|
|
2252
|
-
isDefault: _zod.z.boolean().optional(),
|
|
2253
|
-
description: _zod.z.string().optional(),
|
|
2254
|
-
thumbnailURL: _zod.z.string().optional()
|
|
2255
|
-
});
|
|
2256
2398
|
var PulsarPropertyType = _zod.z.enum([
|
|
2257
2399
|
"string",
|
|
2258
2400
|
"number",
|
|
@@ -2266,47 +2408,56 @@ var PulsarPropertyType = _zod.z.enum([
|
|
|
2266
2408
|
"tokenProperties",
|
|
2267
2409
|
"tokenType"
|
|
2268
2410
|
]);
|
|
2269
|
-
var
|
|
2411
|
+
var PulsarBaseProperty = _zod.z.object({
|
|
2270
2412
|
label: _zod.z.string(),
|
|
2271
2413
|
key: _zod.z.string(),
|
|
2272
|
-
description: _zod.z.string().
|
|
2414
|
+
description: _zod.z.string().nullish(),
|
|
2273
2415
|
type: PulsarPropertyType,
|
|
2274
|
-
values: _zod.z.array(_zod.z.string()).
|
|
2416
|
+
values: _zod.z.array(_zod.z.string()).nullish(),
|
|
2275
2417
|
default: _zod.z.union([_zod.z.string(), _zod.z.boolean(), _zod.z.number()]).nullish(),
|
|
2276
2418
|
// PulsarPropertyValueType //is optional?
|
|
2277
2419
|
inputType: _zod.z.enum(["code", "plain"]).optional(),
|
|
2278
2420
|
//is optional?
|
|
2279
|
-
isMultiline: _zod.z.boolean().
|
|
2421
|
+
isMultiline: _zod.z.boolean().nullish()
|
|
2422
|
+
});
|
|
2423
|
+
var PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({
|
|
2424
|
+
category: _zod.z.string()
|
|
2425
|
+
});
|
|
2426
|
+
var PulsarContributionVariant = _zod.z.object({
|
|
2427
|
+
key: _zod.z.string(),
|
|
2428
|
+
name: _zod.z.string(),
|
|
2429
|
+
isDefault: _zod.z.boolean().nullish(),
|
|
2430
|
+
description: _zod.z.string().nullish(),
|
|
2431
|
+
thumbnailURL: _zod.z.string().nullish()
|
|
2280
2432
|
});
|
|
2281
|
-
var
|
|
2433
|
+
var PulsarCustomBlock = _zod.z.object({
|
|
2282
2434
|
title: _zod.z.string(),
|
|
2283
2435
|
key: _zod.z.string(),
|
|
2284
2436
|
category: _zod.z.string(),
|
|
2285
|
-
description: _zod.z.string()
|
|
2437
|
+
description: nullishToOptional(_zod.z.string()),
|
|
2286
2438
|
iconURL: _zod.z.string(),
|
|
2287
2439
|
mode: _zod.z.enum(["array", "block"]),
|
|
2288
|
-
properties: _zod.z.array(
|
|
2440
|
+
properties: _zod.z.array(PulsarBaseProperty)
|
|
2289
2441
|
});
|
|
2290
|
-
var PulsarContributionConfigurationProperty = BasePulsarProperty.extend({ category: _zod.z.string() });
|
|
2291
2442
|
var ExporterType = _zod.z.enum(["code", "documentation"]);
|
|
2292
2443
|
var ExporterSource = _zod.z.enum(["git", "upload"]);
|
|
2293
2444
|
var ExporterTag = _zod.z.string().regex(/^[0-9a-zA-Z]+(\s[0-9a-zA-Z]+)*$/);
|
|
2294
2445
|
var ExporterDetails = _zod.z.object({
|
|
2295
|
-
packageId: _zod.z.string().max(255),
|
|
2296
|
-
version: _zod.z.string(),
|
|
2297
2446
|
description: _zod.z.string(),
|
|
2447
|
+
version: _zod.z.string(),
|
|
2448
|
+
routingVersion: nullishToOptional(_zod.z.string()),
|
|
2298
2449
|
author: nullishToOptional(_zod.z.string()),
|
|
2299
2450
|
organization: nullishToOptional(_zod.z.string()),
|
|
2300
2451
|
homepage: nullishToOptional(_zod.z.string()),
|
|
2301
2452
|
readme: nullishToOptional(_zod.z.string()),
|
|
2302
|
-
tags: _zod.z.array(ExporterTag).default([]),
|
|
2303
|
-
|
|
2453
|
+
tags: nullishToOptional(_zod.z.array(ExporterTag)).default([]),
|
|
2454
|
+
packageId: nullishToOptional(_zod.z.string().max(255)),
|
|
2304
2455
|
iconURL: nullishToOptional(_zod.z.string()),
|
|
2305
|
-
configurationProperties: _zod.z.array(PulsarContributionConfigurationProperty).default([]),
|
|
2306
|
-
customBlocks: _zod.z.array(
|
|
2307
|
-
blockVariants: _zod.z.record(_zod.z.string(), _zod.z.array(PulsarContributionVariant)).default({}),
|
|
2308
|
-
usesBrands: _zod.z.boolean().default(false),
|
|
2309
|
-
usesThemes: _zod.z.boolean().default(false),
|
|
2456
|
+
configurationProperties: nullishToOptional(_zod.z.array(PulsarContributionConfigurationProperty)).default([]),
|
|
2457
|
+
customBlocks: nullishToOptional(_zod.z.array(PulsarCustomBlock)).default([]),
|
|
2458
|
+
blockVariants: nullishToOptional(_zod.z.record(_zod.z.string(), _zod.z.array(PulsarContributionVariant))).default({}),
|
|
2459
|
+
usesBrands: nullishToOptional(_zod.z.boolean()).default(false),
|
|
2460
|
+
usesThemes: nullishToOptional(_zod.z.boolean()).default(false),
|
|
2310
2461
|
source: ExporterSource,
|
|
2311
2462
|
gitProvider: nullishToOptional(GitProvider),
|
|
2312
2463
|
gitUrl: nullishToOptional(_zod.z.string()),
|
|
@@ -2319,8 +2470,8 @@ var Exporter = _zod.z.object({
|
|
|
2319
2470
|
name: _zod.z.string(),
|
|
2320
2471
|
isPrivate: _zod.z.boolean(),
|
|
2321
2472
|
details: ExporterDetails,
|
|
2322
|
-
exporterType: ExporterType.default("code"),
|
|
2323
|
-
storagePath: _zod.z.string().default("")
|
|
2473
|
+
exporterType: nullishToOptional(ExporterType).default("code"),
|
|
2474
|
+
storagePath: nullishToOptional(_zod.z.string()).default("")
|
|
2324
2475
|
});
|
|
2325
2476
|
var CustomDomain = _zod.z.object({
|
|
2326
2477
|
id: _zod.z.string(),
|
|
@@ -2517,7 +2668,16 @@ var ContentLoaderPayload = _zod.z.object({
|
|
|
2517
2668
|
})
|
|
2518
2669
|
);
|
|
2519
2670
|
|
|
2671
|
+
// src/api/dto/design-system.ts
|
|
2672
|
+
var DesignSystemDTO = DesignSystem.omit({
|
|
2673
|
+
name: true,
|
|
2674
|
+
description: true
|
|
2675
|
+
}).extend({
|
|
2676
|
+
meta: ObjectMeta
|
|
2677
|
+
});
|
|
2678
|
+
|
|
2520
2679
|
// src/api/dto/documentation-v1.ts
|
|
2680
|
+
|
|
2521
2681
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
2522
2682
|
data: true,
|
|
2523
2683
|
meta: true,
|
|
@@ -4131,7 +4291,8 @@ function serializeAsRichTextBlock(input) {
|
|
|
4131
4291
|
const blockItem = BlockParsingUtils.singleBlockItem(block);
|
|
4132
4292
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
4133
4293
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
4134
|
-
const
|
|
4294
|
+
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
4295
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _2 => _2.richTextStyle]), () => ( "Default"));
|
|
4135
4296
|
switch (style) {
|
|
4136
4297
|
case "Callout":
|
|
4137
4298
|
return serializeAsCallout(enrichedInput);
|
|
@@ -4183,11 +4344,12 @@ function serializeAsCallout(input) {
|
|
|
4183
4344
|
};
|
|
4184
4345
|
}
|
|
4185
4346
|
function serializeAsMultiRichTextBlock(input) {
|
|
4186
|
-
const { block, definition, property:
|
|
4347
|
+
const { block, definition, property: multiRichTextProperty } = input;
|
|
4187
4348
|
const blockItem = BlockParsingUtils.singleBlockItem(block);
|
|
4188
|
-
const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem,
|
|
4349
|
+
const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextProperty.id);
|
|
4189
4350
|
const enrichedInput = { ...input, multiRichTextPropertyValue: textPropertyValue };
|
|
4190
|
-
const
|
|
4351
|
+
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
4352
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _3 => _3.multiRichTextStyle]), () => ( "Default"));
|
|
4191
4353
|
switch (style) {
|
|
4192
4354
|
case "Default":
|
|
4193
4355
|
return serializeAsMultiParagraph(enrichedInput);
|
|
@@ -4309,7 +4471,7 @@ function serializeTableNode(node) {
|
|
|
4309
4471
|
return {
|
|
4310
4472
|
type: "image",
|
|
4311
4473
|
attrs: {
|
|
4312
|
-
src: _optionalChain([node, 'access',
|
|
4474
|
+
src: _optionalChain([node, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.url])
|
|
4313
4475
|
}
|
|
4314
4476
|
};
|
|
4315
4477
|
}
|
|
@@ -4355,7 +4517,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
4355
4517
|
};
|
|
4356
4518
|
}
|
|
4357
4519
|
function richTextHeadingLevel(property) {
|
|
4358
|
-
const style = _optionalChain([property, 'access',
|
|
4520
|
+
const style = _optionalChain([property, 'access', _6 => _6.options, 'optionalAccess', _7 => _7.richTextStyle]);
|
|
4359
4521
|
if (!style)
|
|
4360
4522
|
return void 0;
|
|
4361
4523
|
switch (style) {
|
|
@@ -4451,7 +4613,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
4451
4613
|
linksTo: i.linksTo
|
|
4452
4614
|
};
|
|
4453
4615
|
});
|
|
4454
|
-
const columns = _optionalChain([block, 'access',
|
|
4616
|
+
const columns = _optionalChain([block, 'access', _8 => _8.data, 'access', _9 => _9.appearance, 'optionalAccess', _10 => _10.numberOfColumns]);
|
|
4455
4617
|
return {
|
|
4456
4618
|
type: "blockNode",
|
|
4457
4619
|
attrs: {
|
|
@@ -6644,7 +6806,7 @@ var blocks = [
|
|
|
6644
6806
|
}
|
|
6645
6807
|
},
|
|
6646
6808
|
{
|
|
6647
|
-
id: "io.supernova.block.figma-
|
|
6809
|
+
id: "io.supernova.block.figma-nodes",
|
|
6648
6810
|
name: "Figma frames",
|
|
6649
6811
|
description: "Display Figma frames as images",
|
|
6650
6812
|
category: "Figma",
|
|
@@ -6707,7 +6869,7 @@ var blocks = [
|
|
|
6707
6869
|
defaultVariantKey: "bordered"
|
|
6708
6870
|
},
|
|
6709
6871
|
behavior: {
|
|
6710
|
-
dataType: "
|
|
6872
|
+
dataType: "FigmaNode",
|
|
6711
6873
|
entities: {
|
|
6712
6874
|
selectionType: "Entity",
|
|
6713
6875
|
maxSelected: 0
|
|
@@ -7079,7 +7241,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
7079
7241
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
7080
7242
|
if (listItem.type !== "listitem")
|
|
7081
7243
|
return null;
|
|
7082
|
-
if (!_optionalChain([listItem, 'access',
|
|
7244
|
+
if (!_optionalChain([listItem, 'access', _11 => _11.content, 'optionalAccess', _12 => _12.length]))
|
|
7083
7245
|
return parseRichText([]);
|
|
7084
7246
|
const paragraph = listItem.content[0];
|
|
7085
7247
|
if (paragraph.type !== "paragraph")
|
|
@@ -7122,7 +7284,7 @@ function parseRichTextAttribute(mark) {
|
|
|
7122
7284
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
7123
7285
|
return {
|
|
7124
7286
|
type: "Link",
|
|
7125
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7287
|
+
openInNewWindow: _optionalChain([mark, 'access', _13 => _13.attrs, 'optionalAccess', _14 => _14.target]) !== "_self",
|
|
7126
7288
|
documentationItemId: itemId,
|
|
7127
7289
|
link: href
|
|
7128
7290
|
};
|
|
@@ -7135,17 +7297,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7135
7297
|
return null;
|
|
7136
7298
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7137
7299
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
7138
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7300
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _15 => _15.content, 'optionalAccess', _16 => _16.find, 'call', _17 => _17((c) => c.type === "table")]);
|
|
7139
7301
|
if (!tableChild) {
|
|
7140
7302
|
return emptyTable(id, variantId, 0);
|
|
7141
7303
|
}
|
|
7142
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7304
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.filter, 'call', _20 => _20((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _21 => _21.content, 'optionalAccess', _22 => _22.length]))]), () => ( []));
|
|
7143
7305
|
if (!rows.length) {
|
|
7144
7306
|
return emptyTable(id, variantId, 0);
|
|
7145
7307
|
}
|
|
7146
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
7147
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
7148
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7308
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _23 => _23[0], 'access', _24 => _24.content, 'optionalAccess', _25 => _25.filter, 'call', _26 => _26((c) => c.type === "tableHeader"), 'access', _27 => _27.length]), () => ( 0));
|
|
7309
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _28 => _28.content, 'optionalAccess', _29 => _29[0], 'optionalAccess', _30 => _30.type]) === "tableHeader").length;
|
|
7310
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _31 => _31[0], 'access', _32 => _32.content, 'optionalAccess', _33 => _33.length]) === rowHeaderCells;
|
|
7149
7311
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
7150
7312
|
const tableValue = {
|
|
7151
7313
|
showBorder: hasBorder,
|
|
@@ -7422,6 +7584,8 @@ function valueSchemaForPropertyType(type) {
|
|
|
7422
7584
|
return PageBlockItemAssetValue;
|
|
7423
7585
|
case "AssetProperty":
|
|
7424
7586
|
return PageBlockItemAssetPropertyValue;
|
|
7587
|
+
case "FigmaNode":
|
|
7588
|
+
return PageBlockItemFigmaNodeValue;
|
|
7425
7589
|
case "EmbedURL":
|
|
7426
7590
|
return PageBlockItemEmbedValue;
|
|
7427
7591
|
case "URL":
|
|
@@ -7452,7 +7616,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
7452
7616
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
7453
7617
|
}
|
|
7454
7618
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
7455
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
7619
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _34 => _34.attrs, 'optionalAccess', _35 => _35[attributeName]]));
|
|
7456
7620
|
if (parsedAttr.success) {
|
|
7457
7621
|
return parsedAttr.data;
|
|
7458
7622
|
} else {
|
|
@@ -7504,5 +7668,6 @@ function mapByUnique(items, keyFn) {
|
|
|
7504
7668
|
|
|
7505
7669
|
|
|
7506
7670
|
|
|
7507
|
-
|
|
7671
|
+
|
|
7672
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.BulkEditDocPageElementsInput = BulkEditDocPageElementsInput; exports.CreateBulkElementsInput = CreateBulkElementsInput; exports.DeleteBulkElementsInput = DeleteBulkElementsInput; exports.DesignSystemDTO = DesignSystemDTO; exports.DocumentationGroupDTO = DocumentationGroupDTO; exports.DocumentationGroupStructureDTO = DocumentationGroupStructureDTO; exports.DocumentationHierarchyV2DTO = DocumentationHierarchyV2DTO; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageStructureV2DTO = DocumentationPageStructureV2DTO; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.DocumentationPageV2DTO = DocumentationPageV2DTO; exports.DuplicateBulkElementsInput = DuplicateBulkElementsInput; exports.GetBlockDefinitionsResponse = GetBlockDefinitionsResponse; exports.PageBlockEditorModel = PageBlockEditorModel; exports.PostLiveblocksAuth = PostLiveblocksAuth; exports.UpdateBulkElementsInput = UpdateBulkElementsInput; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pmSchema = pmSchema; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorNodeToBlock = prosemirrorNodeToBlock; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
|
|
7508
7673
|
//# sourceMappingURL=index.js.map
|