@supernova-studio/client 0.48.28 → 0.48.30
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2186 -2013
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2206 -2033
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/version-room/frontend.ts +7 -2
- package/src/yjs/version-room/utils.ts +46 -3
package/dist/index.js
CHANGED
|
@@ -45,8 +45,10 @@ var _zod = require('zod');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
var _deepequal = require('deep-equal'); var _deepequal2 = _interopRequireDefault(_deepequal);
|
|
48
49
|
|
|
49
50
|
|
|
51
|
+
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
@@ -116,7 +118,6 @@ var _zod = require('zod');
|
|
|
116
118
|
|
|
117
119
|
|
|
118
120
|
|
|
119
|
-
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
|
|
@@ -176,6 +177,12 @@ var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr)
|
|
|
176
177
|
|
|
177
178
|
|
|
178
179
|
|
|
180
|
+
var __defProp2 = Object.defineProperty;
|
|
181
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
182
|
+
var __publicField2 = (obj, key, value) => {
|
|
183
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
184
|
+
return value;
|
|
185
|
+
};
|
|
179
186
|
var AssetDeleteScheduleStatus = _zod.z.enum(["InProgress", "Pending"]);
|
|
180
187
|
var AssetDeleteSchedule = _zod.z.object({
|
|
181
188
|
id: _zod.z.string(),
|
|
@@ -645,2016 +652,133 @@ var ComponentElementData = _zod.z.object({
|
|
|
645
652
|
}).optional()
|
|
646
653
|
})
|
|
647
654
|
});
|
|
648
|
-
var
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
655
|
+
var SupernovaException = class _SupernovaException extends Error {
|
|
656
|
+
//
|
|
657
|
+
// Properties
|
|
658
|
+
//
|
|
659
|
+
constructor(type, message) {
|
|
660
|
+
super(`${type}: ${message}`);
|
|
661
|
+
this.type = type;
|
|
662
|
+
}
|
|
663
|
+
static wrongFormat(message) {
|
|
664
|
+
return new _SupernovaException("WrongFormat", message);
|
|
665
|
+
}
|
|
666
|
+
static validationError(message) {
|
|
667
|
+
return new _SupernovaException("ValidationError", message);
|
|
668
|
+
}
|
|
669
|
+
static accessDenied(message) {
|
|
670
|
+
return new _SupernovaException("AccessDenied", message);
|
|
671
|
+
}
|
|
672
|
+
static tooMuchWork(message) {
|
|
673
|
+
return new _SupernovaException("TooMuchWork", message);
|
|
674
|
+
}
|
|
675
|
+
static notFound(message) {
|
|
676
|
+
return new _SupernovaException("ResourceNotFound", message);
|
|
677
|
+
}
|
|
678
|
+
static timeout(message) {
|
|
679
|
+
return new _SupernovaException("Timeout", message);
|
|
680
|
+
}
|
|
681
|
+
static conflict(message) {
|
|
682
|
+
return new _SupernovaException("Conflict", message);
|
|
683
|
+
}
|
|
684
|
+
static notImplemented(message) {
|
|
685
|
+
return new _SupernovaException("NotImplemented", message);
|
|
686
|
+
}
|
|
687
|
+
static wrongActionOrder(message) {
|
|
688
|
+
return new _SupernovaException("WrongActionOrder", message);
|
|
689
|
+
}
|
|
690
|
+
static invalidOperation(message) {
|
|
691
|
+
return new _SupernovaException("InvalidOperation", message);
|
|
692
|
+
}
|
|
693
|
+
static shouldNotHappen(message) {
|
|
694
|
+
return new _SupernovaException("UnexpectedError", message);
|
|
695
|
+
}
|
|
696
|
+
static ipRestricted(message) {
|
|
697
|
+
return new _SupernovaException("IPRestricted", message);
|
|
698
|
+
}
|
|
699
|
+
static planRestricted(message) {
|
|
700
|
+
return new _SupernovaException("PlanRestricted", message);
|
|
701
|
+
}
|
|
702
|
+
static missingWorkspacePermission(message) {
|
|
703
|
+
return new _SupernovaException("MissingWorkspacePermission", message);
|
|
704
|
+
}
|
|
705
|
+
static missingExporterPermission(message) {
|
|
706
|
+
return new _SupernovaException("MissingExporterPermission", message);
|
|
707
|
+
}
|
|
708
|
+
static missingIntegration(message) {
|
|
709
|
+
return new _SupernovaException("MissingIntegration", message);
|
|
710
|
+
}
|
|
711
|
+
static missingIntegrationAccess(message) {
|
|
712
|
+
return new _SupernovaException("MissingIntegrationAccess", message);
|
|
713
|
+
}
|
|
714
|
+
static noAccess(message) {
|
|
715
|
+
return new _SupernovaException("NoAccess", message);
|
|
716
|
+
}
|
|
717
|
+
static missingCredentials(message) {
|
|
718
|
+
return new _SupernovaException("MissingCredentials", message);
|
|
719
|
+
}
|
|
720
|
+
static thirdPartyError(message) {
|
|
721
|
+
return new _SupernovaException("ThirdPartyError", message);
|
|
722
|
+
}
|
|
723
|
+
//
|
|
724
|
+
// To refactor
|
|
725
|
+
//
|
|
726
|
+
static badRequest(message) {
|
|
727
|
+
return new _SupernovaException("BadRequest", message);
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
function tryParseUrl(url) {
|
|
731
|
+
try {
|
|
732
|
+
return parseUrl(url);
|
|
733
|
+
} catch (e) {
|
|
734
|
+
console.error(`Error parsing URL ${url}`);
|
|
735
|
+
console.error(e);
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
691
738
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
739
|
+
function parseUrl(url) {
|
|
740
|
+
return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
|
|
741
|
+
}
|
|
742
|
+
function mapByUnique(items, keyFn) {
|
|
743
|
+
const result = /* @__PURE__ */ new Map();
|
|
744
|
+
for (const item of items) {
|
|
745
|
+
result.set(keyFn(item), item);
|
|
746
|
+
}
|
|
747
|
+
return result;
|
|
748
|
+
}
|
|
749
|
+
function groupBy(items, keyFn) {
|
|
750
|
+
const result = /* @__PURE__ */ new Map();
|
|
751
|
+
for (const item of items) {
|
|
752
|
+
const key = keyFn(item);
|
|
753
|
+
const array = result.get(key);
|
|
754
|
+
if (array) {
|
|
755
|
+
array.push(item);
|
|
756
|
+
} else {
|
|
757
|
+
result.set(key, [item]);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
return result;
|
|
761
|
+
}
|
|
762
|
+
var ContentLoadInstruction = _zod.z.object({
|
|
763
|
+
from: _zod.z.string(),
|
|
764
|
+
to: _zod.z.string(),
|
|
765
|
+
authorizationHeaderKvsId: _zod.z.string().optional(),
|
|
766
|
+
timeout: _zod.z.number().optional()
|
|
702
767
|
});
|
|
703
|
-
var
|
|
704
|
-
"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
"BorderWidth",
|
|
718
|
-
"BorderRadius",
|
|
719
|
-
"Duration",
|
|
720
|
-
"ZIndex",
|
|
721
|
-
"Image",
|
|
722
|
-
"String",
|
|
723
|
-
"ProductCopy",
|
|
724
|
-
"FontFamily",
|
|
725
|
-
"FontWeight",
|
|
726
|
-
"TextDecoration",
|
|
727
|
-
"TextCase",
|
|
728
|
-
"Visibility",
|
|
729
|
-
"Typography",
|
|
730
|
-
"Blur",
|
|
731
|
-
"Font"
|
|
732
|
-
]);
|
|
733
|
-
var tokenElementTypes = [...DesignTokenType.options.filter((v) => v !== "Font")];
|
|
734
|
-
var DesignElementType = DesignTokenType.or(
|
|
735
|
-
_zod.z.enum([
|
|
736
|
-
"Component",
|
|
737
|
-
"Theme",
|
|
738
|
-
"Documentation",
|
|
739
|
-
"DocumentationPage",
|
|
740
|
-
"DesignSystemComponent",
|
|
741
|
-
"ElementGroup",
|
|
742
|
-
"FigmaNodeStructure",
|
|
743
|
-
"FigmaNodeReference",
|
|
744
|
-
"PageBlock"
|
|
745
|
-
])
|
|
746
|
-
);
|
|
747
|
-
var DesignElementCategory = _zod.z.enum([
|
|
748
|
-
"Token",
|
|
749
|
-
"Component",
|
|
750
|
-
"DesignSystemComponent",
|
|
751
|
-
"DocumentationPage",
|
|
752
|
-
"Theme",
|
|
753
|
-
"PageBlock"
|
|
754
|
-
]);
|
|
755
|
-
var DesignSystemElementExportProps = _zod.z.object({
|
|
756
|
-
isAsset: _zod.z.boolean().nullish().transform((v) => _nullishCoalesce(v, () => ( false))),
|
|
757
|
-
codeName: _zod.z.string().nullish()
|
|
758
|
-
});
|
|
759
|
-
var ShallowDesignElement = _zod.z.object({
|
|
760
|
-
id: _zod.z.string(),
|
|
761
|
-
persistentId: _zod.z.string(),
|
|
762
|
-
designSystemVersionId: _zod.z.string(),
|
|
763
|
-
type: DesignElementType,
|
|
764
|
-
brandPersistentId: _zod.z.string().optional(),
|
|
765
|
-
parentPersistentId: _zod.z.string().optional(),
|
|
766
|
-
shortPersistentId: _zod.z.string().optional(),
|
|
767
|
-
childType: DesignElementType.optional(),
|
|
768
|
-
sortOrder: _zod.z.number(),
|
|
769
|
-
origin: _zod.z.record(_zod.z.any()).optional(),
|
|
770
|
-
createdAt: _zod.z.coerce.date(),
|
|
771
|
-
updatedAt: _zod.z.coerce.date()
|
|
772
|
-
});
|
|
773
|
-
var DesignElement = ShallowDesignElement.extend({
|
|
774
|
-
meta: ObjectMeta,
|
|
775
|
-
slug: _zod.z.string().optional(),
|
|
776
|
-
userSlug: _zod.z.string().optional(),
|
|
777
|
-
exportProperties: DesignSystemElementExportProps.optional(),
|
|
778
|
-
data: _zod.z.record(_zod.z.any()),
|
|
779
|
-
origin: _zod.z.record(_zod.z.any()).optional()
|
|
780
|
-
});
|
|
781
|
-
var HierarchicalElements = DesignTokenType.or(
|
|
782
|
-
_zod.z.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
|
|
783
|
-
);
|
|
784
|
-
var PageBlockCalloutType = _zod.z.enum(["Info", "Primary", "Success", "Warning", "Error"]);
|
|
785
|
-
var PageBlockTypeV1 = _zod.z.enum([
|
|
786
|
-
"Text",
|
|
787
|
-
"Heading",
|
|
788
|
-
"Code",
|
|
789
|
-
"UnorderedList",
|
|
790
|
-
"OrderedList",
|
|
791
|
-
"Quote",
|
|
792
|
-
"Callout",
|
|
793
|
-
"Divider",
|
|
794
|
-
"Image",
|
|
795
|
-
"Embed",
|
|
796
|
-
"Link",
|
|
797
|
-
"Shortcuts",
|
|
798
|
-
"FigmaEmbed",
|
|
799
|
-
"YoutubeEmbed",
|
|
800
|
-
"StorybookEmbed",
|
|
801
|
-
"Token",
|
|
802
|
-
"TokenGroup",
|
|
803
|
-
"TokenList",
|
|
804
|
-
"Component",
|
|
805
|
-
"ComponentGroup",
|
|
806
|
-
"Theme",
|
|
807
|
-
"ComponentSandbox",
|
|
808
|
-
"Custom",
|
|
809
|
-
"FigmaFrames",
|
|
810
|
-
"ComponentAssets",
|
|
811
|
-
"RenderCode",
|
|
812
|
-
"Tabs",
|
|
813
|
-
"TabItem",
|
|
814
|
-
"Table",
|
|
815
|
-
"TableRow",
|
|
816
|
-
"TableCell",
|
|
817
|
-
"Guidelines"
|
|
818
|
-
]);
|
|
819
|
-
var PageBlockCodeLanguage = _zod.z.enum([
|
|
820
|
-
"Angular",
|
|
821
|
-
"Bash",
|
|
822
|
-
"C",
|
|
823
|
-
"Cpp",
|
|
824
|
-
"Csharp",
|
|
825
|
-
"CSS",
|
|
826
|
-
"Dart",
|
|
827
|
-
"Handlebars",
|
|
828
|
-
"HTML",
|
|
829
|
-
"Java",
|
|
830
|
-
"Javascript",
|
|
831
|
-
"JSON",
|
|
832
|
-
"ReactJSX",
|
|
833
|
-
"ReactTSX",
|
|
834
|
-
"Kotlin",
|
|
835
|
-
"Lua",
|
|
836
|
-
"Markdown",
|
|
837
|
-
"ObjectiveC",
|
|
838
|
-
"PHP",
|
|
839
|
-
"Plain",
|
|
840
|
-
"Python",
|
|
841
|
-
"Ruby",
|
|
842
|
-
"Rust",
|
|
843
|
-
"Sass",
|
|
844
|
-
"SCSS",
|
|
845
|
-
"Svetle",
|
|
846
|
-
"Swift",
|
|
847
|
-
"Twig",
|
|
848
|
-
"Typescript",
|
|
849
|
-
"Vue",
|
|
850
|
-
"XML",
|
|
851
|
-
"YAML"
|
|
852
|
-
]);
|
|
853
|
-
var PageBlockAlignment = _zod.z.enum(["Left", "Center", "Stretch", "Right"]);
|
|
854
|
-
var PageBlockThemeType = _zod.z.enum(["Override", "Comparison"]);
|
|
855
|
-
var PageBlockAssetType = _zod.z.enum(["image", "figmaFrame"]);
|
|
856
|
-
var PageBlockTilesAlignment = _zod.z.enum(["Center", "FrameHeight"]);
|
|
857
|
-
var PageBlockTilesLayout = _zod.z.enum(["C8", "C7", "C6", "C5", "C4", "C3", "C2", "C1", "C1_75"]);
|
|
858
|
-
var PageBlockTheme = _zod.z.object({
|
|
859
|
-
themeIds: _zod.z.array(_zod.z.string()),
|
|
860
|
-
type: PageBlockThemeType
|
|
861
|
-
});
|
|
862
|
-
var PageBlockUrlPreview = _zod.z.object({
|
|
863
|
-
title: nullishToOptional(_zod.z.string()),
|
|
864
|
-
description: nullishToOptional(_zod.z.string()),
|
|
865
|
-
thumbnailUrl: nullishToOptional(_zod.z.string())
|
|
866
|
-
});
|
|
867
|
-
var PageBlockFrameOrigin = _zod.z.object({
|
|
868
|
-
sourceFileName: nullishToOptional(_zod.z.string()),
|
|
869
|
-
title: nullishToOptional(_zod.z.string()),
|
|
870
|
-
previewUrl: nullishToOptional(_zod.z.string()),
|
|
871
|
-
valid: nullishToOptional(_zod.z.boolean()),
|
|
872
|
-
referenceId: nullishToOptional(_zod.z.string()),
|
|
873
|
-
assetId: nullishToOptional(_zod.z.string()),
|
|
874
|
-
assetScale: nullishToOptional(_zod.z.number()),
|
|
875
|
-
width: nullishToOptional(_zod.z.number()),
|
|
876
|
-
height: nullishToOptional(_zod.z.number())
|
|
877
|
-
});
|
|
878
|
-
var PageBlockFrame = _zod.z.object({
|
|
879
|
-
persistentId: _zod.z.string(),
|
|
880
|
-
sourceId: _zod.z.string(),
|
|
881
|
-
sourceFrameId: _zod.z.string(),
|
|
882
|
-
title: nullishToOptional(_zod.z.string()),
|
|
883
|
-
description: nullishToOptional(_zod.z.string()),
|
|
884
|
-
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
885
|
-
origin: nullishToOptional(PageBlockFrameOrigin)
|
|
886
|
-
});
|
|
887
|
-
var PageBlockAsset = _zod.z.object({
|
|
888
|
-
type: PageBlockAssetType,
|
|
889
|
-
id: nullishToOptional(_zod.z.string()),
|
|
890
|
-
url: nullishToOptional(_zod.z.string()),
|
|
891
|
-
figmaFrame: nullishToOptional(PageBlockFrame)
|
|
892
|
-
});
|
|
893
|
-
var PageBlockLinkPreview = _zod.z.object({
|
|
894
|
-
title: nullishToOptional(_zod.z.string()),
|
|
895
|
-
valid: nullishToOptional(_zod.z.boolean())
|
|
896
|
-
});
|
|
897
|
-
var PageBlockShortcut = _zod.z.object({
|
|
898
|
-
persistentId: _zod.z.string(),
|
|
899
|
-
title: nullishToOptional(_zod.z.string()),
|
|
900
|
-
description: nullishToOptional(_zod.z.string()),
|
|
901
|
-
asset: nullishToOptional(PageBlockAsset),
|
|
902
|
-
documentationItemId: nullishToOptional(_zod.z.string()),
|
|
903
|
-
pageHeadingId: nullishToOptional(_zod.z.string()),
|
|
904
|
-
url: nullishToOptional(_zod.z.string()),
|
|
905
|
-
openInNewTab: nullishToOptional(_zod.z.boolean()),
|
|
906
|
-
urlPreview: nullishToOptional(PageBlockUrlPreview),
|
|
907
|
-
documentationItemPreview: nullishToOptional(PageBlockLinkPreview)
|
|
908
|
-
});
|
|
909
|
-
var PageBlockCustomBlockPropertyImageValue = _zod.z.object({
|
|
910
|
-
asset: nullishToOptional(PageBlockAsset),
|
|
911
|
-
assetId: nullishToOptional(_zod.z.string()),
|
|
912
|
-
assetUrl: nullishToOptional(_zod.z.string())
|
|
913
|
-
});
|
|
914
|
-
var PageBlockCustomBlockPropertyValue = _zod.z.object({
|
|
915
|
-
key: _zod.z.string(),
|
|
916
|
-
value: _zod.z.any()
|
|
917
|
-
// TODO Artem: for some reason there are cases when there's an array here in the DB
|
|
918
|
-
// e.g. element id 67451 in the dev db
|
|
919
|
-
// value: z
|
|
920
|
-
// .boolean()
|
|
921
|
-
// .or(z.number())
|
|
922
|
-
// .or(z.string())
|
|
923
|
-
// .or(ColorTokenData)
|
|
924
|
-
// .or(TypographyTokenData)
|
|
925
|
-
// .or(PageBlockCustomBlockPropertyImageValue),
|
|
926
|
-
});
|
|
927
|
-
var PageBlockFigmaFrameProperties = _zod.z.object({
|
|
928
|
-
color: nullishToOptional(
|
|
929
|
-
_zod.z.object({
|
|
930
|
-
value: _zod.z.string()
|
|
931
|
-
})
|
|
932
|
-
),
|
|
933
|
-
alignment: PageBlockTilesAlignment,
|
|
934
|
-
layout: PageBlockTilesLayout,
|
|
935
|
-
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
936
|
-
showTitles: _zod.z.boolean()
|
|
937
|
-
});
|
|
938
|
-
var PageBlockRenderCodeProperties = _zod.z.object({
|
|
939
|
-
showCode: _zod.z.boolean(),
|
|
940
|
-
showControls: _zod.z.boolean().optional()
|
|
941
|
-
});
|
|
942
|
-
var PageBlockAssetComponent = _zod.z.object({
|
|
943
|
-
persistentId: _zod.z.string(),
|
|
944
|
-
componentAssetId: _zod.z.string(),
|
|
945
|
-
title: nullishToOptional(_zod.z.string()),
|
|
946
|
-
description: nullishToOptional(_zod.z.string()),
|
|
947
|
-
backgroundColor: nullishToOptional(ColorTokenInlineData)
|
|
948
|
-
});
|
|
949
|
-
var PageBlockTableColumn = _zod.z.object({
|
|
950
|
-
id: _zod.z.string(),
|
|
951
|
-
width: DimensionTokenData
|
|
952
|
-
});
|
|
953
|
-
var PageBlockTableProperties = _zod.z.object({
|
|
954
|
-
showBorders: _zod.z.boolean(),
|
|
955
|
-
showHeaderRow: _zod.z.boolean(),
|
|
956
|
-
showHeaderColumn: _zod.z.boolean(),
|
|
957
|
-
columns: _zod.z.array(PageBlockTableColumn)
|
|
958
|
-
});
|
|
959
|
-
var PageBlockTextSpanAttributeType = _zod.z.enum(["Bold", "Italic", "Link", "Strikethrough", "Code", "Comment"]);
|
|
960
|
-
var PageBlockTextSpanAttribute = _zod.z.object({
|
|
961
|
-
type: PageBlockTextSpanAttributeType,
|
|
962
|
-
// Link attributes
|
|
963
|
-
link: nullishToOptional(_zod.z.string()),
|
|
964
|
-
documentationItemId: nullishToOptional(_zod.z.string()),
|
|
965
|
-
openInNewWindow: nullishToOptional(_zod.z.boolean()),
|
|
966
|
-
// deprecated. use openInNewTab
|
|
967
|
-
openInNewTab: nullishToOptional(_zod.z.boolean()),
|
|
968
|
-
// Comment attributes
|
|
969
|
-
commentHighlightId: nullishToOptional(_zod.z.string()),
|
|
970
|
-
commentIsResolved: nullishToOptional(_zod.z.boolean())
|
|
971
|
-
});
|
|
972
|
-
var PageBlockTextSpan = _zod.z.object({
|
|
973
|
-
text: _zod.z.string(),
|
|
974
|
-
attributes: _zod.z.array(PageBlockTextSpanAttribute)
|
|
975
|
-
});
|
|
976
|
-
var PageBlockText = _zod.z.object({
|
|
977
|
-
spans: _zod.z.array(PageBlockTextSpan)
|
|
978
|
-
});
|
|
979
|
-
var PageBlockGuideline = _zod.z.object({
|
|
980
|
-
description: nullishToOptional(_zod.z.string()),
|
|
981
|
-
asset: nullishToOptional(PageBlockAsset),
|
|
982
|
-
type: _zod.z.string()
|
|
983
|
-
});
|
|
984
|
-
var PageBlockBaseV1 = _zod.z.object({
|
|
985
|
-
persistentId: _zod.z.string(),
|
|
986
|
-
type: PageBlockTypeV1,
|
|
987
|
-
numberOfColumns: nullishToOptional(_zod.z.number()),
|
|
988
|
-
// Element linking
|
|
989
|
-
designObjectId: nullishToOptional(_zod.z.string()),
|
|
990
|
-
designObjectIds: nullishToOptional(_zod.z.array(_zod.z.string())),
|
|
991
|
-
tokenType: nullishToOptional(DesignTokenType.or(_zod.z.literal("Font"))),
|
|
992
|
-
showNestedGroups: nullishToOptional(_zod.z.boolean()),
|
|
993
|
-
brandId: nullishToOptional(_zod.z.string()),
|
|
994
|
-
// Rich text
|
|
995
|
-
text: nullishToOptional(PageBlockText),
|
|
996
|
-
caption: nullishToOptional(_zod.z.string()),
|
|
997
|
-
headingType: nullishToOptional(_zod.z.number().min(1).max(3)),
|
|
998
|
-
codeLanguage: nullishToOptional(PageBlockCodeLanguage),
|
|
999
|
-
calloutType: nullishToOptional(PageBlockCalloutType),
|
|
1000
|
-
urlInput: nullishToOptional(_zod.z.string()),
|
|
1001
|
-
url: nullishToOptional(_zod.z.string()),
|
|
1002
|
-
urlPreview: nullishToOptional(PageBlockUrlPreview),
|
|
1003
|
-
// Image
|
|
1004
|
-
asset: nullishToOptional(PageBlockAsset),
|
|
1005
|
-
alignment: nullishToOptional(PageBlockAlignment),
|
|
1006
|
-
// Shortcuts block
|
|
1007
|
-
shortcuts: nullishToOptional(_zod.z.array(PageBlockShortcut)),
|
|
1008
|
-
// Guidelines
|
|
1009
|
-
guidelines: nullishToOptional(PageBlockGuideline.array()),
|
|
1010
|
-
// Custom blocks
|
|
1011
|
-
customBlockKey: nullishToOptional(_zod.z.string()),
|
|
1012
|
-
customBlockProperties: nullishToOptional(_zod.z.array(PageBlockCustomBlockPropertyValue)),
|
|
1013
|
-
variantKey: nullishToOptional(_zod.z.string()),
|
|
1014
|
-
// Figma frames
|
|
1015
|
-
figmaFrameProperties: nullishToOptional(PageBlockFigmaFrameProperties),
|
|
1016
|
-
figmaFrames: nullishToOptional(_zod.z.array(PageBlockFrame)),
|
|
1017
|
-
// Generic
|
|
1018
|
-
size: nullishToOptional(Size),
|
|
1019
|
-
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
1020
|
-
// Render code
|
|
1021
|
-
renderCodeProperties: nullishToOptional(PageBlockRenderCodeProperties),
|
|
1022
|
-
// Component assets
|
|
1023
|
-
componentAssets: nullishToOptional(_zod.z.array(PageBlockAssetComponent)),
|
|
1024
|
-
// Tables
|
|
1025
|
-
tableProperties: nullishToOptional(PageBlockTableProperties),
|
|
1026
|
-
columnId: nullishToOptional(_zod.z.string()),
|
|
1027
|
-
// Token spreadsheet
|
|
1028
|
-
theme: nullishToOptional(PageBlockTheme),
|
|
1029
|
-
blacklistedElementProperties: nullishToOptional(_zod.z.array(_zod.z.string())),
|
|
1030
|
-
// Arbitrary
|
|
1031
|
-
userMetadata: nullishToOptional(_zod.z.string())
|
|
1032
|
-
});
|
|
1033
|
-
var PageBlockV1 = PageBlockBaseV1.extend({
|
|
1034
|
-
children: _zod.z.lazy(
|
|
1035
|
-
() => PageBlockV1.array().nullish().transform((t) => _nullishCoalesce(t, () => ( [])))
|
|
1036
|
-
)
|
|
1037
|
-
});
|
|
1038
|
-
var PageBlockLinkType = _zod.z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
1039
|
-
var PageBlockImageType = _zod.z.enum(["Resource", "FigmaNode"]);
|
|
1040
|
-
var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
1041
|
-
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
1042
|
-
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
1043
|
-
var PageBlockThemeDisplayMode = _zod.z.enum(["Split", "Override"]);
|
|
1044
|
-
var PageBlockImageResourceReference = _zod.z.object({
|
|
1045
|
-
resourceId: _zod.z.string(),
|
|
1046
|
-
url: _zod.z.string()
|
|
1047
|
-
});
|
|
1048
|
-
var PageBlockResourceFrameNodeReference = _zod.z.object({
|
|
1049
|
-
sourceId: _zod.z.string(),
|
|
1050
|
-
frameReferenceId: _zod.z.string()
|
|
1051
|
-
});
|
|
1052
|
-
var PageBlockImageReference = _zod.z.object({
|
|
1053
|
-
type: PageBlockImageType,
|
|
1054
|
-
resource: PageBlockImageResourceReference.optional(),
|
|
1055
|
-
figmaNode: PageBlockResourceFrameNodeReference.optional()
|
|
1056
|
-
});
|
|
1057
|
-
var PageBlockColorV2 = _zod.z.object({
|
|
1058
|
-
value: _zod.z.string(),
|
|
1059
|
-
referencedTokenId: _zod.z.string().optional()
|
|
1060
|
-
});
|
|
1061
|
-
var PageBlockAssetEntityMeta = _zod.z.object({
|
|
1062
|
-
title: _zod.z.string().optional(),
|
|
1063
|
-
description: _zod.z.string().optional(),
|
|
1064
|
-
backgroundColor: PageBlockColorV2.optional()
|
|
1065
|
-
});
|
|
1066
|
-
var PageBlockFigmaComponentEntityMeta = _zod.z.object({
|
|
1067
|
-
title: _zod.z.string().optional(),
|
|
1068
|
-
description: _zod.z.string().optional(),
|
|
1069
|
-
backgroundColor: PageBlockColorV2.optional(),
|
|
1070
|
-
selectedComponentProperties: _zod.z.array(_zod.z.string()).optional()
|
|
1071
|
-
});
|
|
1072
|
-
var PageBlockFigmaNodeEntityMeta = _zod.z.object({
|
|
1073
|
-
title: _zod.z.string().optional(),
|
|
1074
|
-
description: _zod.z.string().optional(),
|
|
1075
|
-
backgroundColor: PageBlockColorV2.optional()
|
|
1076
|
-
});
|
|
1077
|
-
var PageBlockAppearanceV2 = _zod.z.object({
|
|
1078
|
-
itemBackgroundColor: PageBlockColorV2.optional(),
|
|
1079
|
-
numberOfColumns: _zod.z.number().optional()
|
|
1080
|
-
});
|
|
1081
|
-
var PageBlockItemUntypedValue = _zod.z.object({
|
|
1082
|
-
value: _zod.z.any()
|
|
1083
|
-
}).and(_zod.z.record(_zod.z.any()));
|
|
1084
|
-
var PageBlockLinkV2 = _zod.z.object({
|
|
1085
|
-
type: PageBlockLinkType,
|
|
1086
|
-
documentationItemId: _zod.z.string().optional(),
|
|
1087
|
-
pageHeadingId: _zod.z.string().optional(),
|
|
1088
|
-
url: _zod.z.string().optional(),
|
|
1089
|
-
openInNewTab: _zod.z.boolean().optional()
|
|
1090
|
-
});
|
|
1091
|
-
var PageBlockItemV2 = _zod.z.object({
|
|
1092
|
-
id: _zod.z.string(),
|
|
1093
|
-
linksTo: PageBlockLinkV2.optional(),
|
|
1094
|
-
props: _zod.z.record(PageBlockItemUntypedValue)
|
|
1095
|
-
});
|
|
1096
|
-
var PageBlockDataV2 = _zod.z.object({
|
|
1097
|
-
packageId: _zod.z.string(),
|
|
1098
|
-
variantId: _zod.z.string().optional(),
|
|
1099
|
-
indentLevel: _zod.z.number(),
|
|
1100
|
-
appearance: PageBlockAppearanceV2.optional(),
|
|
1101
|
-
items: _zod.z.array(PageBlockItemV2)
|
|
1102
|
-
});
|
|
1103
|
-
var PageBlockItemAssetValue = _zod.z.object({
|
|
1104
|
-
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1105
|
-
showSearch: _zod.z.boolean().optional(),
|
|
1106
|
-
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
1107
|
-
backgroundColor: PageBlockColorV2.optional(),
|
|
1108
|
-
value: _zod.z.array(
|
|
1109
|
-
_zod.z.object({
|
|
1110
|
-
entityId: _zod.z.string(),
|
|
1111
|
-
entityType: _zod.z.enum(["Asset", "AssetGroup"]),
|
|
1112
|
-
entityMeta: PageBlockAssetEntityMeta.optional()
|
|
1113
|
-
})
|
|
1114
|
-
).default([])
|
|
1115
|
-
});
|
|
1116
|
-
var PageBlockItemAssetPropertyValue = _zod.z.object({
|
|
1117
|
-
value: _zod.z.array(_zod.z.string()).default([])
|
|
1118
|
-
});
|
|
1119
|
-
var PageBlockItemFigmaComponentValue = _zod.z.object({
|
|
1120
|
-
showComponentName: _zod.z.boolean().optional(),
|
|
1121
|
-
showComponentDescription: _zod.z.boolean().optional(),
|
|
1122
|
-
showPropertyList: _zod.z.boolean().optional(),
|
|
1123
|
-
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
1124
|
-
backgroundColor: PageBlockColorV2.optional(),
|
|
1125
|
-
value: _zod.z.array(
|
|
1126
|
-
_zod.z.object({
|
|
1127
|
-
entityId: _zod.z.string(),
|
|
1128
|
-
entityType: _zod.z.enum(["FigmaComponent"]),
|
|
1129
|
-
entityMeta: PageBlockFigmaComponentEntityMeta.optional()
|
|
1130
|
-
})
|
|
1131
|
-
).default([])
|
|
1132
|
-
});
|
|
1133
|
-
var PageBlockItemBooleanValue = _zod.z.object({
|
|
1134
|
-
value: _zod.z.boolean()
|
|
1135
|
-
});
|
|
1136
|
-
var PageBlockItemCodeValue = _zod.z.object({
|
|
1137
|
-
format: PageBlockCodeLanguage.optional(),
|
|
1138
|
-
caption: _zod.z.string().optional(),
|
|
1139
|
-
value: _zod.z.string()
|
|
1140
|
-
});
|
|
1141
|
-
var PageBlockItemSandboxValue = _zod.z.object({
|
|
1142
|
-
showCode: _zod.z.boolean().optional(),
|
|
1143
|
-
showControls: _zod.z.boolean().optional(),
|
|
1144
|
-
backgroundColor: _zod.z.string().optional(),
|
|
1145
|
-
alignPreview: _zod.z.enum(["Left", "Center"]).optional(),
|
|
1146
|
-
previewHeight: _zod.z.number().optional(),
|
|
1147
|
-
value: _zod.z.string()
|
|
1148
|
-
});
|
|
1149
|
-
var PageBlockItemColorValue = _zod.z.record(_zod.z.any());
|
|
1150
|
-
var PageBlockItemComponentValue = _zod.z.object({
|
|
1151
|
-
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1152
|
-
value: _zod.z.array(
|
|
1153
|
-
_zod.z.object({
|
|
1154
|
-
entityId: _zod.z.string(),
|
|
1155
|
-
entityType: _zod.z.enum(["Component", "ComponentGroup"])
|
|
1156
|
-
})
|
|
1157
|
-
).default([])
|
|
1158
|
-
});
|
|
1159
|
-
var PageBlockItemComponentPropertyValue = _zod.z.object({
|
|
1160
|
-
value: _zod.z.string()
|
|
1161
|
-
});
|
|
1162
|
-
var PageBlockItemDividerValue = _zod.z.object({});
|
|
1163
|
-
var PageBlockItemEmbedValue = _zod.z.object({
|
|
1164
|
-
value: _zod.z.string().optional(),
|
|
1165
|
-
caption: _zod.z.string().optional(),
|
|
1166
|
-
height: _zod.z.number().optional(),
|
|
1167
|
-
openGraph: _zod.z.object({
|
|
1168
|
-
title: _zod.z.string().optional(),
|
|
1169
|
-
description: _zod.z.string().optional(),
|
|
1170
|
-
imageUrl: _zod.z.string().optional()
|
|
1171
|
-
}).optional()
|
|
1172
|
-
});
|
|
1173
|
-
var PageBlockItemFigmaNodeValue = _zod.z.object({
|
|
1174
|
-
showSearch: _zod.z.boolean().optional(),
|
|
1175
|
-
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
1176
|
-
backgroundColor: PageBlockColorV2.optional(),
|
|
1177
|
-
showFrameDetails: _zod.z.boolean().optional(),
|
|
1178
|
-
value: _zod.z.array(
|
|
1179
|
-
_zod.z.object({
|
|
1180
|
-
entityId: _zod.z.string(),
|
|
1181
|
-
entityMeta: PageBlockFigmaNodeEntityMeta.optional()
|
|
1182
|
-
})
|
|
1183
|
-
).default([])
|
|
1184
|
-
});
|
|
1185
|
-
var PageBlockItemImageValue = _zod.z.object({
|
|
1186
|
-
alt: _zod.z.string().optional(),
|
|
1187
|
-
caption: _zod.z.string().optional(),
|
|
1188
|
-
alignment: PageBlockImageAlignment.optional(),
|
|
1189
|
-
value: PageBlockImageReference.optional()
|
|
1190
|
-
});
|
|
1191
|
-
var PageBlockItemMarkdownValue = _zod.z.object({
|
|
1192
|
-
value: _zod.z.string()
|
|
1193
|
-
});
|
|
1194
|
-
var PageBlockItemMultiRichTextValue = _zod.z.object({
|
|
1195
|
-
value: PageBlockText.array()
|
|
1196
|
-
});
|
|
1197
|
-
var PageBlockItemMultiSelectValue = _zod.z.object({
|
|
1198
|
-
value: _zod.z.array(_zod.z.string()).default([])
|
|
1199
|
-
});
|
|
1200
|
-
var PageBlockItemNumberValue = _zod.z.object({
|
|
1201
|
-
value: _zod.z.number()
|
|
1202
|
-
});
|
|
1203
|
-
var PageBlockItemRichTextValue = _zod.z.object({
|
|
1204
|
-
value: PageBlockText,
|
|
1205
|
-
calloutType: PageBlockCalloutType.optional()
|
|
1206
|
-
});
|
|
1207
|
-
var PageBlockItemSingleSelectValue = _zod.z.object({
|
|
1208
|
-
value: _zod.z.string()
|
|
1209
|
-
});
|
|
1210
|
-
var PageBlockItemStorybookValue = _zod.z.object({
|
|
1211
|
-
caption: _zod.z.string().optional(),
|
|
1212
|
-
height: _zod.z.number().optional(),
|
|
1213
|
-
embedUrl: _zod.z.string().optional(),
|
|
1214
|
-
value: _zod.z.string().optional()
|
|
1215
|
-
});
|
|
1216
|
-
var PageBlockItemTextValue = _zod.z.object({
|
|
1217
|
-
value: _zod.z.string()
|
|
1218
|
-
});
|
|
1219
|
-
var PageBlockItemTokenValue = _zod.z.object({
|
|
1220
|
-
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1221
|
-
selectedThemeIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1222
|
-
themeDisplayMode: PageBlockThemeDisplayMode.optional(),
|
|
1223
|
-
value: _zod.z.array(
|
|
1224
|
-
_zod.z.object({
|
|
1225
|
-
entityId: _zod.z.string(),
|
|
1226
|
-
entityType: _zod.z.enum(["Token", "TokenGroup"]),
|
|
1227
|
-
entityMeta: _zod.z.object({
|
|
1228
|
-
showNestedGroups: _zod.z.boolean().optional()
|
|
1229
|
-
}).optional()
|
|
1230
|
-
})
|
|
1231
|
-
).default([])
|
|
1232
|
-
});
|
|
1233
|
-
var PageBlockItemTokenPropertyValue = _zod.z.object({
|
|
1234
|
-
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1235
|
-
selectedThemeIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1236
|
-
value: _zod.z.array(_zod.z.string()).default([])
|
|
1237
|
-
});
|
|
1238
|
-
var PageBlockItemTokenTypeValue = _zod.z.object({
|
|
1239
|
-
value: _zod.z.array(DesignTokenType).default([])
|
|
1240
|
-
});
|
|
1241
|
-
var PageBlockItemUrlValue = _zod.z.object({
|
|
1242
|
-
value: _zod.z.string()
|
|
1243
|
-
});
|
|
1244
|
-
var PageBlockItemTableRichTextNode = _zod.z.object({
|
|
1245
|
-
type: _zod.z.literal("RichText"),
|
|
1246
|
-
id: _zod.z.string(),
|
|
1247
|
-
value: PageBlockItemRichTextValue.shape.value
|
|
1248
|
-
});
|
|
1249
|
-
var PageBlockItemTableMultiRichTextNode = _zod.z.object({
|
|
1250
|
-
type: _zod.z.literal("MultiRichText"),
|
|
1251
|
-
value: PageBlockItemMultiRichTextValue.shape.value
|
|
1252
|
-
});
|
|
1253
|
-
var PageBlockItemTableImageNode = _zod.z.object({
|
|
1254
|
-
type: _zod.z.literal("Image"),
|
|
1255
|
-
id: _zod.z.string(),
|
|
1256
|
-
caption: PageBlockItemImageValue.shape.caption,
|
|
1257
|
-
value: PageBlockItemImageValue.shape.value
|
|
1258
|
-
});
|
|
1259
|
-
var PageBlockItemTableNode = _zod.z.discriminatedUnion("type", [
|
|
1260
|
-
PageBlockItemTableRichTextNode,
|
|
1261
|
-
// PageBlockItemTableMultiRichTextNode,
|
|
1262
|
-
PageBlockItemTableImageNode
|
|
1263
|
-
]);
|
|
1264
|
-
var PageBlockItemTableCell = _zod.z.object({
|
|
1265
|
-
id: _zod.z.string(),
|
|
1266
|
-
nodes: _zod.z.array(PageBlockItemTableNode),
|
|
1267
|
-
columnWidth: _zod.z.number().optional(),
|
|
1268
|
-
alignment: PageBlockTableCellAlignment
|
|
1269
|
-
});
|
|
1270
|
-
var PageBlockItemTableRow = _zod.z.object({
|
|
1271
|
-
cells: _zod.z.array(PageBlockItemTableCell)
|
|
1272
|
-
});
|
|
1273
|
-
var PageBlockItemTableValue = _zod.z.object({
|
|
1274
|
-
highlightHeaderColumn: _zod.z.boolean().optional(),
|
|
1275
|
-
highlightHeaderRow: _zod.z.boolean().optional(),
|
|
1276
|
-
showBorder: _zod.z.boolean().optional(),
|
|
1277
|
-
value: _zod.z.array(PageBlockItemTableRow).default([])
|
|
1278
|
-
});
|
|
1279
|
-
var DocumentationItemHeaderAlignmentSchema = _zod.z.enum(["Left", "Center"]);
|
|
1280
|
-
var DocumentationItemHeaderImageScaleTypeSchema = _zod.z.enum(["AspectFill", "AspectFit"]);
|
|
1281
|
-
var DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;
|
|
1282
|
-
var DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTypeSchema.enum;
|
|
1283
|
-
var DocumentationItemHeaderV1 = _zod.z.object({
|
|
1284
|
-
description: _zod.z.string(),
|
|
1285
|
-
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
1286
|
-
foregroundColor: ColorTokenData.nullish(),
|
|
1287
|
-
backgroundColor: ColorTokenData.nullish(),
|
|
1288
|
-
backgroundImageAsset: PageBlockAsset.nullish(),
|
|
1289
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
1290
|
-
showBackgroundOverlay: _zod.z.boolean(),
|
|
1291
|
-
showCoverText: _zod.z.boolean(),
|
|
1292
|
-
minHeight: _zod.z.number().nullish()
|
|
1293
|
-
});
|
|
1294
|
-
var defaultDocumentationItemHeaderV1 = {
|
|
1295
|
-
alignment: DocumentationItemHeaderAlignment.Left,
|
|
1296
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
1297
|
-
description: "",
|
|
1298
|
-
showBackgroundOverlay: false,
|
|
1299
|
-
showCoverText: true
|
|
1300
|
-
};
|
|
1301
|
-
var DocumentationItemConfigurationV1 = _zod.z.object({
|
|
1302
|
-
showSidebar: _zod.z.boolean(),
|
|
1303
|
-
isPrivate: _zod.z.boolean().optional(),
|
|
1304
|
-
isHidden: _zod.z.boolean().optional(),
|
|
1305
|
-
header: DocumentationItemHeaderV1
|
|
1306
|
-
});
|
|
1307
|
-
var DocumentationPageDataV1 = _zod.z.object({
|
|
1308
|
-
blocks: _zod.z.array(PageBlockV1),
|
|
1309
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV1)
|
|
1310
|
-
});
|
|
1311
|
-
var DocumentationItemHeaderV2 = _zod.z.object({
|
|
1312
|
-
description: _zod.z.string(),
|
|
1313
|
-
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
1314
|
-
foregroundColor: PageBlockColorV2.nullish(),
|
|
1315
|
-
backgroundColor: PageBlockColorV2.nullish(),
|
|
1316
|
-
backgroundImageAsset: PageBlockImageReference.nullish(),
|
|
1317
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
1318
|
-
showBackgroundOverlay: _zod.z.boolean(),
|
|
1319
|
-
showCoverText: _zod.z.boolean(),
|
|
1320
|
-
minHeight: _zod.z.number().nullish()
|
|
1321
|
-
});
|
|
1322
|
-
var defaultDocumentationItemHeaderV2 = {
|
|
1323
|
-
alignment: DocumentationItemHeaderAlignment.Left,
|
|
1324
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
1325
|
-
description: "",
|
|
1326
|
-
showBackgroundOverlay: false,
|
|
1327
|
-
showCoverText: true
|
|
1328
|
-
};
|
|
1329
|
-
var DocumentationItemConfigurationV2 = _zod.z.object({
|
|
1330
|
-
showSidebar: _zod.z.boolean(),
|
|
1331
|
-
isPrivate: _zod.z.boolean().optional(),
|
|
1332
|
-
isHidden: _zod.z.boolean().optional(),
|
|
1333
|
-
header: DocumentationItemHeaderV2
|
|
1334
|
-
});
|
|
1335
|
-
var defaultDocumentationItemConfigurationV2 = {
|
|
1336
|
-
header: defaultDocumentationItemHeaderV2,
|
|
1337
|
-
isHidden: false,
|
|
1338
|
-
isPrivate: false,
|
|
1339
|
-
showSidebar: true
|
|
1340
|
-
};
|
|
1341
|
-
var DocumentationPageDataV2 = _zod.z.object({
|
|
1342
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV2)
|
|
1343
|
-
});
|
|
1344
|
-
var DesignElementOrigin = _zod.z.object({
|
|
1345
|
-
id: _zod.z.string(),
|
|
1346
|
-
sourceId: _zod.z.string(),
|
|
1347
|
-
name: _zod.z.string()
|
|
1348
|
-
});
|
|
1349
|
-
var DesignElementBase = _zod.z.object({
|
|
1350
|
-
id: _zod.z.string(),
|
|
1351
|
-
persistentId: _zod.z.string(),
|
|
1352
|
-
meta: ObjectMeta,
|
|
1353
|
-
designSystemVersionId: _zod.z.string(),
|
|
1354
|
-
createdAt: _zod.z.coerce.date(),
|
|
1355
|
-
updatedAt: _zod.z.coerce.date()
|
|
1356
|
-
});
|
|
1357
|
-
var DesignElementImportedBase = DesignElementBase.extend({
|
|
1358
|
-
origin: DesignElementOrigin
|
|
1359
|
-
});
|
|
1360
|
-
var DesignElementGroupablePart = _zod.z.object({
|
|
1361
|
-
parentPersistentId: _zod.z.string().optional(),
|
|
1362
|
-
sortOrder: _zod.z.number()
|
|
1363
|
-
});
|
|
1364
|
-
var DesignElementGroupableBase = DesignElementBase.extend(DesignElementGroupablePart.shape);
|
|
1365
|
-
var DesignElementGroupableRequiredPart = DesignElementGroupablePart.extend({
|
|
1366
|
-
parentPersistentId: _zod.z.string()
|
|
1367
|
-
});
|
|
1368
|
-
var DesignElementBrandedPart = _zod.z.object({
|
|
1369
|
-
brandPersistentId: _zod.z.string()
|
|
1370
|
-
});
|
|
1371
|
-
var DesignElementSlugPart = _zod.z.object({
|
|
1372
|
-
slug: _zod.z.string().optional(),
|
|
1373
|
-
userSlug: _zod.z.string().optional()
|
|
1374
|
-
});
|
|
1375
|
-
var PageBlockV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend({
|
|
1376
|
-
data: PageBlockDataV2
|
|
1377
|
-
});
|
|
1378
|
-
var PageBlockEditorModelV2 = _zod.z.object({
|
|
1379
|
-
id: _zod.z.string(),
|
|
1380
|
-
type: _zod.z.literal("Block"),
|
|
1381
|
-
data: PageBlockDataV2
|
|
1382
|
-
});
|
|
1383
|
-
var PageSectionTypeV2 = _zod.z.enum(["Tabs"]);
|
|
1384
|
-
var PageSectionColumnV2 = _zod.z.object({
|
|
1385
|
-
id: _zod.z.string(),
|
|
1386
|
-
blocks: _zod.z.array(PageBlockEditorModelV2)
|
|
1387
|
-
});
|
|
1388
|
-
var PageSectionItemV2 = _zod.z.object({
|
|
1389
|
-
id: _zod.z.string(),
|
|
1390
|
-
title: _zod.z.string(),
|
|
1391
|
-
columns: _zod.z.array(PageSectionColumnV2)
|
|
1392
|
-
});
|
|
1393
|
-
var PageSectionPaddingV2 = _zod.z.object({
|
|
1394
|
-
top: _zod.z.number().optional(),
|
|
1395
|
-
bottom: _zod.z.number().optional(),
|
|
1396
|
-
left: _zod.z.number().optional(),
|
|
1397
|
-
right: _zod.z.number().optional()
|
|
1398
|
-
});
|
|
1399
|
-
var PageSectionAppearanceV2 = _zod.z.object({
|
|
1400
|
-
expandToEdges: _zod.z.boolean(),
|
|
1401
|
-
contentExpandToEdges: _zod.z.boolean(),
|
|
1402
|
-
backgroundColor: PageBlockColorV2.optional(),
|
|
1403
|
-
foregroundColor: PageBlockColorV2.optional(),
|
|
1404
|
-
padding: PageSectionPaddingV2.optional()
|
|
1405
|
-
});
|
|
1406
|
-
var PageSectionEditorModelV2 = _zod.z.object({
|
|
1407
|
-
id: _zod.z.string(),
|
|
1408
|
-
type: _zod.z.literal("Section"),
|
|
1409
|
-
variantId: _zod.z.string().optional(),
|
|
1410
|
-
sectionType: PageSectionTypeV2,
|
|
1411
|
-
appearance: PageSectionAppearanceV2,
|
|
1412
|
-
items: _zod.z.array(PageSectionItemV2)
|
|
1413
|
-
});
|
|
1414
|
-
var DurationUnit = _zod.z.enum(["Ms"]);
|
|
1415
|
-
var DurationValue = _zod.z.object({
|
|
1416
|
-
unit: DurationUnit,
|
|
1417
|
-
measure: _zod.z.number()
|
|
1418
|
-
});
|
|
1419
|
-
var DurationTokenData = tokenAliasOrValue(DurationValue);
|
|
1420
|
-
var FigmaFileStructureNodeType = _zod.z.enum(["DOCUMENT", "CANVAS", "FRAME", "COMPONENT", "COMPONENT_SET"]);
|
|
1421
|
-
var FigmaFileStructureNodeBase = _zod.z.object({
|
|
1422
|
-
id: _zod.z.string(),
|
|
1423
|
-
name: _zod.z.string(),
|
|
1424
|
-
type: FigmaFileStructureNodeType,
|
|
1425
|
-
size: SizeOrUndefined,
|
|
1426
|
-
parentComponentSetId: _zod.z.string().optional()
|
|
1427
|
-
});
|
|
1428
|
-
var FigmaFileStructureNode = FigmaFileStructureNodeBase.extend({
|
|
1429
|
-
children: _zod.z.lazy(() => FigmaFileStructureNode.array())
|
|
1430
|
-
});
|
|
1431
|
-
var FigmaFileStructureStatistics = _zod.z.object({
|
|
1432
|
-
frames: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0))),
|
|
1433
|
-
components: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0))),
|
|
1434
|
-
componentSets: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0)))
|
|
1435
|
-
});
|
|
1436
|
-
var FigmaFileStructureElementData = _zod.z.object({
|
|
1437
|
-
value: _zod.z.object({
|
|
1438
|
-
structure: FigmaFileStructureNode,
|
|
1439
|
-
assetsInFile: FigmaFileStructureStatistics
|
|
1440
|
-
})
|
|
1441
|
-
});
|
|
1442
|
-
var FigmaNodeReferenceData = _zod.z.object({
|
|
1443
|
-
structureElementId: _zod.z.string(),
|
|
1444
|
-
nodeId: _zod.z.string(),
|
|
1445
|
-
fileId: _zod.z.string().optional(),
|
|
1446
|
-
valid: _zod.z.boolean(),
|
|
1447
|
-
// Asset data
|
|
1448
|
-
assetId: _zod.z.string().optional(),
|
|
1449
|
-
assetScale: _zod.z.number().optional(),
|
|
1450
|
-
assetWidth: _zod.z.number().optional(),
|
|
1451
|
-
assetHeight: _zod.z.number().optional(),
|
|
1452
|
-
assetUrl: _zod.z.string().optional(),
|
|
1453
|
-
assetOriginKey: _zod.z.string().optional()
|
|
1454
|
-
});
|
|
1455
|
-
var FigmaNodeReferenceElementData = _zod.z.object({
|
|
1456
|
-
value: FigmaNodeReferenceData
|
|
1457
|
-
});
|
|
1458
|
-
var FontFamilyValue = _zod.z.string();
|
|
1459
|
-
var FontFamilyTokenData = tokenAliasOrValue(FontFamilyValue);
|
|
1460
|
-
var FontSizeUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1461
|
-
var FontSizeValue = _zod.z.object({
|
|
1462
|
-
unit: FontSizeUnit,
|
|
1463
|
-
measure: _zod.z.number()
|
|
1464
|
-
});
|
|
1465
|
-
var FontSizeTokenData = tokenAliasOrValue(FontSizeValue);
|
|
1466
|
-
var FontWeightValue = _zod.z.string();
|
|
1467
|
-
var FontWeightTokenData = tokenAliasOrValue(FontWeightValue);
|
|
1468
|
-
var GradientType = _zod.z.enum(["Linear", "Radial", "Angular"]);
|
|
1469
|
-
var GradientStop = _zod.z.object({
|
|
1470
|
-
position: _zod.z.number(),
|
|
1471
|
-
color: ColorTokenData
|
|
1472
|
-
});
|
|
1473
|
-
var GradientLayerValue = _zod.z.object({
|
|
1474
|
-
from: Point2D,
|
|
1475
|
-
to: Point2D,
|
|
1476
|
-
type: GradientType,
|
|
1477
|
-
aspectRatio: nullishToOptional(_zod.z.number()),
|
|
1478
|
-
// z.number(),
|
|
1479
|
-
stops: _zod.z.array(GradientStop).min(2)
|
|
1480
|
-
});
|
|
1481
|
-
var GradientLayerData = tokenAliasOrValue(GradientLayerValue);
|
|
1482
|
-
var GradientTokenValue = _zod.z.array(GradientLayerData);
|
|
1483
|
-
var GradientTokenData = tokenAliasOrValue(GradientTokenValue);
|
|
1484
|
-
var DocumentationGroupBehavior = _zod.z.enum(["Group", "Tabs"]);
|
|
1485
|
-
var ElementGroupDataV1 = _zod.z.object({
|
|
1486
|
-
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
1487
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV1)
|
|
1488
|
-
});
|
|
1489
|
-
var ElementGroupDataV2 = _zod.z.object({
|
|
1490
|
-
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
1491
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV2)
|
|
1492
|
-
});
|
|
1493
|
-
var LetterSpacingUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1494
|
-
var LetterSpacingValue = _zod.z.object({
|
|
1495
|
-
unit: LetterSpacingUnit,
|
|
1496
|
-
measure: _zod.z.number()
|
|
1497
|
-
});
|
|
1498
|
-
var LetterSpacingTokenData = tokenAliasOrValue(LetterSpacingValue);
|
|
1499
|
-
var LineHeightUnit = _zod.z.enum(["Pixels", "Rem", "Percent", "Raw"]);
|
|
1500
|
-
var LineHeightValue = _zod.z.object({
|
|
1501
|
-
unit: LineHeightUnit,
|
|
1502
|
-
measure: _zod.z.number()
|
|
1503
|
-
});
|
|
1504
|
-
var LineHeightTokenData = tokenAliasOrValue(LineHeightValue);
|
|
1505
|
-
var ParagraphIndentUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1506
|
-
var ParagraphIndentValue = _zod.z.object({
|
|
1507
|
-
unit: ParagraphIndentUnit,
|
|
1508
|
-
measure: _zod.z.number()
|
|
1509
|
-
});
|
|
1510
|
-
var ParagraphIndentTokenData = tokenAliasOrValue(ParagraphIndentValue);
|
|
1511
|
-
var ParagraphSpacingUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1512
|
-
var ParagraphSpacingValue = _zod.z.object({
|
|
1513
|
-
unit: ParagraphSpacingUnit,
|
|
1514
|
-
measure: _zod.z.number()
|
|
1515
|
-
});
|
|
1516
|
-
var ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);
|
|
1517
|
-
var ProductCopyValue = _zod.z.string();
|
|
1518
|
-
var ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);
|
|
1519
|
-
var RESERVED_OBJECT_ID_PREFIX = "x-sn-reserved-";
|
|
1520
|
-
var SafeIdSchema = _zod.z.string().refine(
|
|
1521
|
-
(value) => {
|
|
1522
|
-
return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`
|
|
1526
|
-
}
|
|
1527
|
-
);
|
|
1528
|
-
var ShadowType = _zod.z.enum(["Drop", "Inner"]);
|
|
1529
|
-
var ShadowLayerValue = _zod.z.object({
|
|
1530
|
-
color: ColorTokenData,
|
|
1531
|
-
x: _zod.z.number(),
|
|
1532
|
-
y: _zod.z.number(),
|
|
1533
|
-
radius: _zod.z.number(),
|
|
1534
|
-
spread: _zod.z.number(),
|
|
1535
|
-
opacity: OpacityTokenData.optional(),
|
|
1536
|
-
type: ShadowType
|
|
1537
|
-
});
|
|
1538
|
-
var ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);
|
|
1539
|
-
var ShadowTokenData = tokenAliasOrValue(_zod.z.array(ShadowTokenDataBase));
|
|
1540
|
-
var SizeUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1541
|
-
var SizeValue = _zod.z.object({
|
|
1542
|
-
unit: SizeUnit,
|
|
1543
|
-
measure: _zod.z.number()
|
|
1544
|
-
});
|
|
1545
|
-
var SizeTokenData = tokenAliasOrValue(SizeValue);
|
|
1546
|
-
var SpaceUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
1547
|
-
var SpaceValue = _zod.z.object({
|
|
1548
|
-
unit: SpaceUnit,
|
|
1549
|
-
measure: _zod.z.number()
|
|
1550
|
-
});
|
|
1551
|
-
var SpaceTokenData = tokenAliasOrValue(SpaceValue);
|
|
1552
|
-
var StringValue = _zod.z.string();
|
|
1553
|
-
var StringTokenData = tokenAliasOrValue(StringValue);
|
|
1554
|
-
var TextCase = _zod.z.enum(["Original", "Upper", "Lower", "Camel", "SmallCaps"]);
|
|
1555
|
-
var TextCaseValue = TextCase;
|
|
1556
|
-
var TextCaseTokenData = tokenAliasOrValue(TextCaseValue);
|
|
1557
|
-
var TextDecoration = _zod.z.enum(["None", "Underline", "Strikethrough"]);
|
|
1558
|
-
var TextDecorationValue = TextDecoration;
|
|
1559
|
-
var TextDecorationTokenData = tokenAliasOrValue(TextDecorationValue);
|
|
1560
|
-
var TypographyValue = _zod.z.object({
|
|
1561
|
-
fontSize: FontSizeTokenData,
|
|
1562
|
-
fontFamily: FontFamilyTokenData,
|
|
1563
|
-
fontWeight: FontWeightTokenData,
|
|
1564
|
-
textDecoration: TextDecorationTokenData,
|
|
1565
|
-
textCase: TextCaseTokenData,
|
|
1566
|
-
letterSpacing: LetterSpacingTokenData.optional(),
|
|
1567
|
-
lineHeight: LineHeightTokenData.optional(),
|
|
1568
|
-
paragraphIndent: ParagraphIndentTokenData.optional(),
|
|
1569
|
-
paragraphSpacing: ParagraphSpacingTokenData.optional()
|
|
1570
|
-
});
|
|
1571
|
-
var TypographyTokenData = tokenAliasOrValue(TypographyValue);
|
|
1572
|
-
var Visibility = _zod.z.enum(["Hidden", "Visible"]);
|
|
1573
|
-
var VisibilityValue = Visibility;
|
|
1574
|
-
var VisibilityTokenData = tokenAliasOrValue(VisibilityValue);
|
|
1575
|
-
var ZIndexUnit = _zod.z.enum(["Raw"]);
|
|
1576
|
-
var ZIndexValue = _zod.z.object({
|
|
1577
|
-
unit: ZIndexUnit,
|
|
1578
|
-
measure: _zod.z.number()
|
|
1579
|
-
});
|
|
1580
|
-
var ZIndexTokenData = tokenAliasOrValue(ZIndexValue);
|
|
1581
|
-
var FigmaComponentPropertyType = _zod.z.enum(["Boolean", "InstanceSwap", "Variant", "Text"]);
|
|
1582
|
-
var FigmaComponentBooleanProperty = _zod.z.object({
|
|
1583
|
-
type: _zod.z.literal(FigmaComponentPropertyType.enum.Boolean),
|
|
1584
|
-
value: _zod.z.boolean(),
|
|
1585
|
-
defaultValue: _zod.z.boolean()
|
|
1586
|
-
});
|
|
1587
|
-
var FigmaComponentInstanceSwapProperty = _zod.z.object({
|
|
1588
|
-
type: _zod.z.literal(FigmaComponentPropertyType.enum.InstanceSwap),
|
|
1589
|
-
value: _zod.z.string()
|
|
1590
|
-
// Persistent ID of a Component to swap?
|
|
1591
|
-
});
|
|
1592
|
-
var FigmaComponentVariantProperty = _zod.z.object({
|
|
1593
|
-
type: _zod.z.literal(FigmaComponentPropertyType.enum.Variant),
|
|
1594
|
-
value: _zod.z.string(),
|
|
1595
|
-
options: _zod.z.array(_zod.z.string())
|
|
1596
|
-
});
|
|
1597
|
-
var FigmaComponentTextProperty = _zod.z.object({
|
|
1598
|
-
type: _zod.z.literal(FigmaComponentPropertyType.enum.Text),
|
|
1599
|
-
value: _zod.z.string()
|
|
1600
|
-
});
|
|
1601
|
-
var FigmaComponentProperties = _zod.z.record(
|
|
1602
|
-
_zod.z.string(),
|
|
1603
|
-
_zod.z.discriminatedUnion("type", [
|
|
1604
|
-
FigmaComponentBooleanProperty,
|
|
1605
|
-
FigmaComponentInstanceSwapProperty,
|
|
1606
|
-
FigmaComponentTextProperty
|
|
1607
|
-
])
|
|
1608
|
-
);
|
|
1609
|
-
var FigmaComponentSetProperties = _zod.z.record(
|
|
1610
|
-
_zod.z.string(),
|
|
1611
|
-
_zod.z.discriminatedUnion("type", [
|
|
1612
|
-
FigmaComponentBooleanProperty,
|
|
1613
|
-
FigmaComponentInstanceSwapProperty,
|
|
1614
|
-
FigmaComponentTextProperty,
|
|
1615
|
-
FigmaComponentVariantProperty
|
|
1616
|
-
])
|
|
1617
|
-
);
|
|
1618
|
-
var ComponentOriginPart = _zod.z.object({
|
|
1619
|
-
nodeId: _zod.z.string().optional(),
|
|
1620
|
-
width: _zod.z.number().optional(),
|
|
1621
|
-
height: _zod.z.number().optional()
|
|
1622
|
-
});
|
|
1623
|
-
var ComponentAsset = _zod.z.object({
|
|
1624
|
-
assetId: _zod.z.string(),
|
|
1625
|
-
assetPath: _zod.z.string()
|
|
1626
|
-
});
|
|
1627
|
-
var ComponentOrigin = DesignElementOrigin.extend(ComponentOriginPart.shape);
|
|
1628
|
-
var BaseComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementBrandedPart.shape).extend({
|
|
1629
|
-
origin: ComponentOrigin.optional(),
|
|
1630
|
-
thumbnail: ComponentAsset
|
|
1631
|
-
});
|
|
1632
|
-
var Component = BaseComponent.extend({
|
|
1633
|
-
svg: ComponentAsset.optional(),
|
|
1634
|
-
isAsset: _zod.z.boolean(),
|
|
1635
|
-
componentSetId: _zod.z.string().optional(),
|
|
1636
|
-
properties: FigmaComponentProperties.optional()
|
|
1637
|
-
});
|
|
1638
|
-
var ComponentSet = BaseComponent.extend({
|
|
1639
|
-
properties: FigmaComponentSetProperties
|
|
1640
|
-
});
|
|
1641
|
-
var ElementGroup = DesignElementBase.extend(DesignElementGroupablePart.shape).extend(DesignElementSlugPart.shape).extend(DesignElementBrandedPart.partial().shape).extend({
|
|
1642
|
-
shortPersistentId: _zod.z.string().optional(),
|
|
1643
|
-
childType: DesignElementType,
|
|
1644
|
-
data: ElementGroupDataV2.optional()
|
|
1645
|
-
});
|
|
1646
|
-
var BrandedElementGroup = ElementGroup.extend(DesignElementBrandedPart.shape);
|
|
1647
|
-
var DocumentationPageV1 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementSlugPart.shape).extend({
|
|
1648
|
-
shortPersistentId: _zod.z.string(),
|
|
1649
|
-
data: DocumentationPageDataV1
|
|
1650
|
-
});
|
|
1651
|
-
var DocumentationGroupV1 = ElementGroup.omit({
|
|
1652
|
-
data: true
|
|
1653
|
-
}).extend({
|
|
1654
|
-
data: ElementGroupDataV1.optional()
|
|
1655
|
-
});
|
|
1656
|
-
var DocumentationPageV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementSlugPart.shape).extend({
|
|
1657
|
-
shortPersistentId: _zod.z.string(),
|
|
1658
|
-
data: DocumentationPageDataV2.extend({
|
|
1659
|
-
oldBlocks: _zod.z.array(PageBlockV1).optional()
|
|
1660
|
-
})
|
|
1661
|
-
});
|
|
1662
|
-
var FigmaFileStructureOrigin = _zod.z.object({
|
|
1663
|
-
sourceId: _zod.z.string(),
|
|
1664
|
-
fileId: _zod.z.string().optional()
|
|
1665
|
-
});
|
|
1666
|
-
var FigmaFileStructureData = _zod.z.object({
|
|
1667
|
-
rootNode: FigmaFileStructureNode,
|
|
1668
|
-
assetsInFile: FigmaFileStructureStatistics
|
|
1669
|
-
});
|
|
1670
|
-
var FigmaFileStructure = DesignElementBase.extend({
|
|
1671
|
-
origin: FigmaFileStructureOrigin,
|
|
1672
|
-
data: FigmaFileStructureData
|
|
1673
|
-
});
|
|
1674
|
-
var FigmaNodeReferenceOrigin = _zod.z.object({
|
|
1675
|
-
sourceId: _zod.z.string(),
|
|
1676
|
-
parentName: _zod.z.string().optional()
|
|
1677
|
-
});
|
|
1678
|
-
var FigmaNodeReference = DesignElementBase.extend({
|
|
1679
|
-
data: FigmaNodeReferenceData,
|
|
1680
|
-
origin: FigmaNodeReferenceOrigin
|
|
1681
|
-
});
|
|
1682
|
-
var DesignTokenOriginPart = _zod.z.object({
|
|
1683
|
-
referenceOriginId: _zod.z.string().optional(),
|
|
1684
|
-
referenceOriginKey: _zod.z.string().optional(),
|
|
1685
|
-
referencePersistentId: _zod.z.string().optional(),
|
|
1686
|
-
referenceResolutionFailed: _zod.z.boolean().optional(),
|
|
1687
|
-
key: _zod.z.string().optional()
|
|
1688
|
-
});
|
|
1689
|
-
var DesignTokenOrigin = DesignElementOrigin.extend(DesignTokenOriginPart.shape);
|
|
1690
|
-
var DesignTokenBase = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementBrandedPart.shape).extend({
|
|
1691
|
-
origin: DesignTokenOrigin.optional()
|
|
1692
|
-
});
|
|
1693
|
-
var CreateDesignTokenBase = DesignTokenBase.omit(zodCreateInputOmit());
|
|
1694
|
-
var UpdateDesignTokenBase = DesignTokenBase.omit({
|
|
1695
|
-
...zodUpdateInputOmit(),
|
|
1696
|
-
brandPersistentId: true,
|
|
1697
|
-
designSystemVersionId: true
|
|
1698
|
-
});
|
|
1699
|
-
var BlurTokenTypedData = _zod.z.object({
|
|
1700
|
-
type: _zod.z.literal("Blur"),
|
|
1701
|
-
data: BlurTokenData
|
|
1702
|
-
});
|
|
1703
|
-
var ColorTokenTypedData = _zod.z.object({
|
|
1704
|
-
type: _zod.z.literal("Color"),
|
|
1705
|
-
data: ColorTokenData
|
|
1706
|
-
});
|
|
1707
|
-
var GradientTokenTypedData = _zod.z.object({
|
|
1708
|
-
type: _zod.z.literal("Gradient"),
|
|
1709
|
-
data: GradientTokenData
|
|
1710
|
-
});
|
|
1711
|
-
var OpacityTokenTypedData = _zod.z.object({
|
|
1712
|
-
type: _zod.z.literal("Opacity"),
|
|
1713
|
-
data: OpacityTokenData
|
|
1714
|
-
});
|
|
1715
|
-
var ShadowTokenTypedData = _zod.z.object({
|
|
1716
|
-
type: _zod.z.literal("Shadow"),
|
|
1717
|
-
data: ShadowTokenData
|
|
1718
|
-
});
|
|
1719
|
-
var TypographyTokenTypedData = _zod.z.object({
|
|
1720
|
-
type: _zod.z.literal("Typography"),
|
|
1721
|
-
data: TypographyTokenData
|
|
1722
|
-
});
|
|
1723
|
-
var StringTokenTypedData = _zod.z.object({
|
|
1724
|
-
type: _zod.z.literal("String"),
|
|
1725
|
-
data: StringTokenData
|
|
1726
|
-
});
|
|
1727
|
-
var DimensionTokenTypedData = _zod.z.object({
|
|
1728
|
-
type: _zod.z.literal("Dimension"),
|
|
1729
|
-
data: DimensionTokenData
|
|
1730
|
-
});
|
|
1731
|
-
var FontSizeTokenTypedData = _zod.z.object({
|
|
1732
|
-
type: _zod.z.literal("FontSize"),
|
|
1733
|
-
data: FontSizeTokenData
|
|
1734
|
-
});
|
|
1735
|
-
var FontFamilyTokenTypedData = _zod.z.object({
|
|
1736
|
-
type: _zod.z.literal("FontFamily"),
|
|
1737
|
-
data: FontFamilyTokenData
|
|
1738
|
-
});
|
|
1739
|
-
var FontWeightTokenTypedData = _zod.z.object({
|
|
1740
|
-
type: _zod.z.literal("FontWeight"),
|
|
1741
|
-
data: FontWeightTokenData
|
|
1742
|
-
});
|
|
1743
|
-
var LetterSpacingTokenTypedData = _zod.z.object({
|
|
1744
|
-
type: _zod.z.literal("LetterSpacing"),
|
|
1745
|
-
data: LetterSpacingTokenData
|
|
1746
|
-
});
|
|
1747
|
-
var LineHeightTokenTypedData = _zod.z.object({
|
|
1748
|
-
type: _zod.z.literal("LineHeight"),
|
|
1749
|
-
data: LineHeightTokenData
|
|
1750
|
-
});
|
|
1751
|
-
var ParagraphSpacingTokenTypedData = _zod.z.object({
|
|
1752
|
-
type: _zod.z.literal("ParagraphSpacing"),
|
|
1753
|
-
data: ParagraphSpacingTokenData
|
|
1754
|
-
});
|
|
1755
|
-
var TextCaseTokenTypedData = _zod.z.object({
|
|
1756
|
-
type: _zod.z.literal("TextCase"),
|
|
1757
|
-
data: TextCaseTokenData
|
|
1758
|
-
});
|
|
1759
|
-
var TextDecorationTokenTypedData = _zod.z.object({
|
|
1760
|
-
type: _zod.z.literal("TextDecoration"),
|
|
1761
|
-
data: TextDecorationTokenData
|
|
1762
|
-
});
|
|
1763
|
-
var BorderRadiusTokenTypedData = _zod.z.object({
|
|
1764
|
-
type: _zod.z.literal("BorderRadius"),
|
|
1765
|
-
data: BorderRadiusTokenData
|
|
1766
|
-
});
|
|
1767
|
-
var BorderWidthTokenTypedData = _zod.z.object({
|
|
1768
|
-
type: _zod.z.literal("BorderWidth"),
|
|
1769
|
-
data: BorderWidthTokenData
|
|
1770
|
-
});
|
|
1771
|
-
var BorderTypedData = _zod.z.object({
|
|
1772
|
-
type: _zod.z.literal("Border"),
|
|
1773
|
-
data: BorderTokenData
|
|
1774
|
-
});
|
|
1775
|
-
var ProductCopyTypedData = _zod.z.object({
|
|
1776
|
-
type: _zod.z.literal("ProductCopy"),
|
|
1777
|
-
data: ProductCopyTokenData
|
|
1778
|
-
});
|
|
1779
|
-
var SizeTypedData = _zod.z.object({
|
|
1780
|
-
type: _zod.z.literal("Size"),
|
|
1781
|
-
data: SizeTokenData
|
|
1782
|
-
});
|
|
1783
|
-
var SpaceTypedData = _zod.z.object({
|
|
1784
|
-
type: _zod.z.literal("Space"),
|
|
1785
|
-
data: SpaceTokenData
|
|
1786
|
-
});
|
|
1787
|
-
var VisibilityTypedData = _zod.z.object({
|
|
1788
|
-
type: _zod.z.literal("Visibility"),
|
|
1789
|
-
data: VisibilityTokenData
|
|
1790
|
-
});
|
|
1791
|
-
var ZIndexTypedData = _zod.z.object({
|
|
1792
|
-
type: _zod.z.literal("ZIndex"),
|
|
1793
|
-
data: ZIndexTokenData
|
|
1794
|
-
});
|
|
1795
|
-
var DurationTypedData = _zod.z.object({
|
|
1796
|
-
type: _zod.z.literal("Duration"),
|
|
1797
|
-
data: DurationTokenData
|
|
1798
|
-
});
|
|
1799
|
-
var FontTypedData = _zod.z.object({
|
|
1800
|
-
type: _zod.z.literal("Font"),
|
|
1801
|
-
data: _zod.z.record(_zod.z.any())
|
|
1802
|
-
});
|
|
1803
|
-
var DesignTokenTypedData = _zod.z.discriminatedUnion("type", [
|
|
1804
|
-
BlurTokenTypedData,
|
|
1805
|
-
BorderRadiusTokenTypedData,
|
|
1806
|
-
BorderWidthTokenTypedData,
|
|
1807
|
-
BorderTypedData,
|
|
1808
|
-
ColorTokenTypedData,
|
|
1809
|
-
DimensionTokenTypedData,
|
|
1810
|
-
DurationTypedData,
|
|
1811
|
-
FontSizeTokenTypedData,
|
|
1812
|
-
FontFamilyTokenTypedData,
|
|
1813
|
-
FontWeightTokenTypedData,
|
|
1814
|
-
GradientTokenTypedData,
|
|
1815
|
-
LetterSpacingTokenTypedData,
|
|
1816
|
-
LineHeightTokenTypedData,
|
|
1817
|
-
OpacityTokenTypedData,
|
|
1818
|
-
ParagraphSpacingTokenTypedData,
|
|
1819
|
-
ProductCopyTypedData,
|
|
1820
|
-
ShadowTokenTypedData,
|
|
1821
|
-
SizeTypedData,
|
|
1822
|
-
SpaceTypedData,
|
|
1823
|
-
StringTokenTypedData,
|
|
1824
|
-
TextCaseTokenTypedData,
|
|
1825
|
-
TextDecorationTokenTypedData,
|
|
1826
|
-
TypographyTokenTypedData,
|
|
1827
|
-
VisibilityTypedData,
|
|
1828
|
-
ZIndexTypedData,
|
|
1829
|
-
FontTypedData
|
|
1830
|
-
]);
|
|
1831
|
-
var DesignToken = DesignTokenTypedData.and(DesignTokenBase);
|
|
1832
|
-
var CreateDesignToken = DesignTokenTypedData.and(CreateDesignTokenBase);
|
|
1833
|
-
var ThemeOverrideOriginPart = DesignTokenOriginPart;
|
|
1834
|
-
var ThemeOverrideOrigin = DesignTokenOrigin;
|
|
1835
|
-
var ThemeOverride = DesignTokenTypedData.and(
|
|
1836
|
-
_zod.z.object({
|
|
1837
|
-
tokenPersistentId: _zod.z.string(),
|
|
1838
|
-
origin: ThemeOverrideOrigin.optional().nullable().transform((v) => _nullishCoalesce(v, () => ( void 0)))
|
|
1839
|
-
})
|
|
1840
|
-
);
|
|
1841
|
-
var ThemeElementData = _zod.z.object({
|
|
1842
|
-
value: _zod.z.object({
|
|
1843
|
-
overrides: _zod.z.array(ThemeOverride)
|
|
1844
|
-
})
|
|
1845
|
-
});
|
|
1846
|
-
var ThemeOriginPart = _zod.z.object({});
|
|
1847
|
-
var ThemeOriginObject = _zod.z.object({
|
|
1848
|
-
id: _zod.z.string(),
|
|
1849
|
-
name: _zod.z.string()
|
|
1850
|
-
});
|
|
1851
|
-
var ThemeOriginSource = _zod.z.object({
|
|
1852
|
-
sourceId: _zod.z.string(),
|
|
1853
|
-
sourceObjects: _zod.z.array(ThemeOriginObject)
|
|
1854
|
-
});
|
|
1855
|
-
var ThemeOrigin = _zod.z.object({
|
|
1856
|
-
sources: _zod.z.array(ThemeOriginSource)
|
|
1857
|
-
});
|
|
1858
|
-
var Theme = DesignElementBase.extend(DesignElementBrandedPart.shape).extend({
|
|
1859
|
-
origin: ThemeOrigin.optional(),
|
|
1860
|
-
overrides: _zod.z.array(ThemeOverride),
|
|
1861
|
-
codeName: _zod.z.string()
|
|
1862
|
-
});
|
|
1863
|
-
var FileStructureStats = _zod.z.object({
|
|
1864
|
-
frames: zeroNumberByDefault(),
|
|
1865
|
-
components: zeroNumberByDefault(),
|
|
1866
|
-
componentSets: zeroNumberByDefault()
|
|
1867
|
-
});
|
|
1868
|
-
var SourceImportSummaryByTokenTypeKey = DesignTokenType.or(
|
|
1869
|
-
// Backward compatibility
|
|
1870
|
-
_zod.z.enum(["Measure", "Radius", "GenericToken", "Font", "Text"])
|
|
1871
|
-
);
|
|
1872
|
-
var SourceImportSummaryByTokenType = _zod.z.record(SourceImportSummaryByTokenTypeKey, _zod.z.number());
|
|
1873
|
-
var SourceImportTokenSummary = _zod.z.object({
|
|
1874
|
-
tokensCreated: zeroNumberByDefault(),
|
|
1875
|
-
tokensUpdated: zeroNumberByDefault(),
|
|
1876
|
-
tokensDeleted: zeroNumberByDefault(),
|
|
1877
|
-
tokensCreatedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {}))),
|
|
1878
|
-
tokensUpdatedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {}))),
|
|
1879
|
-
tokensDeletedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {})))
|
|
1880
|
-
});
|
|
1881
|
-
var SourceImportComponentSummary = _zod.z.object({
|
|
1882
|
-
componentsCreated: zeroNumberByDefault(),
|
|
1883
|
-
componentsUpdated: zeroNumberByDefault(),
|
|
1884
|
-
componentsDeleted: zeroNumberByDefault(),
|
|
1885
|
-
componentAssetsCreated: zeroNumberByDefault(),
|
|
1886
|
-
componentAssetsUpdated: zeroNumberByDefault(),
|
|
1887
|
-
componentAssetsDeleted: zeroNumberByDefault()
|
|
1888
|
-
});
|
|
1889
|
-
var SourceImportFrameSummary = _zod.z.object({
|
|
1890
|
-
assetsInFile: nullishToOptional(FileStructureStats.optional()),
|
|
1891
|
-
invalidReferencesCount: nullishToOptional(_zod.z.number().optional())
|
|
1892
|
-
});
|
|
1893
|
-
var SourceImportSummary = _zod.z.object({
|
|
1894
|
-
sourceId: nullishToOptional(_zod.z.string()),
|
|
1895
|
-
brandId: nullishToOptional(_zod.z.string()),
|
|
1896
|
-
versionId: nullishToOptional(_zod.z.string()),
|
|
1897
|
-
error: nullishToOptional(_zod.z.any()),
|
|
1898
|
-
isFailed: _zod.z.boolean(),
|
|
1899
|
-
warnings: _zod.z.array(ImportWarning).nullish().transform((v) => _nullishCoalesce(v, () => ( []))),
|
|
1900
|
-
...SourceImportTokenSummary.shape,
|
|
1901
|
-
...SourceImportComponentSummary.shape,
|
|
1902
|
-
...FileStructureStats.shape
|
|
1903
|
-
});
|
|
1904
|
-
function zeroNumberByDefault() {
|
|
1905
|
-
return _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( 0)));
|
|
1906
|
-
}
|
|
1907
|
-
var DataSourceRemoteType = _zod.z.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
|
|
1908
|
-
var DataSourceUploadRemoteSource = _zod.z.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
|
|
1909
|
-
var DataSourceFigmaState = _zod.z.enum(["Active", "MissingIntegration", "MissingFileAccess", "MissingFileOwner"]);
|
|
1910
|
-
var DataSourceAutoImportMode = _zod.z.enum(["Never", "Hourly"]);
|
|
1911
|
-
var DataSourceStats = _zod.z.object({
|
|
1912
|
-
tokens: zeroNumberByDefault2(),
|
|
1913
|
-
components: zeroNumberByDefault2(),
|
|
1914
|
-
assets: zeroNumberByDefault2(),
|
|
1915
|
-
frames: zeroNumberByDefault2()
|
|
1916
|
-
});
|
|
1917
|
-
var DataSourceFigmaFileData = _zod.z.object({
|
|
1918
|
-
lastUpdatedAt: _zod.z.coerce.date()
|
|
1919
|
-
});
|
|
1920
|
-
var DataSourceFigmaFileVersionData = _zod.z.object({
|
|
1921
|
-
id: _zod.z.string(),
|
|
1922
|
-
label: _zod.z.string().optional(),
|
|
1923
|
-
description: _zod.z.string().optional(),
|
|
1924
|
-
createdAt: _zod.z.coerce.date()
|
|
1925
|
-
});
|
|
1926
|
-
var DataSourceFigmaScope = _zod.z.object({
|
|
1927
|
-
assets: _zod.z.boolean(),
|
|
1928
|
-
components: _zod.z.boolean(),
|
|
1929
|
-
documentationFrames: _zod.z.boolean(),
|
|
1930
|
-
tokens: _zod.z.boolean(),
|
|
1931
|
-
themePersistentId: _zod.z.string().optional(),
|
|
1932
|
-
isUnpublishedContentFallbackEnabled: _zod.z.boolean()
|
|
1933
|
-
});
|
|
1934
|
-
var DataSourceFigmaImportMetadata = _zod.z.object({
|
|
1935
|
-
fileData: DataSourceFigmaFileData.optional(),
|
|
1936
|
-
importedPublishedVersion: DataSourceFigmaFileVersionData.optional()
|
|
1937
|
-
});
|
|
1938
|
-
var DataSourceFigmaRemote = _zod.z.object({
|
|
1939
|
-
type: _zod.z.literal(DataSourceRemoteType.Enum.Figma),
|
|
1940
|
-
fileId: _zod.z.string(),
|
|
1941
|
-
preferredCredentialId: _zod.z.string().optional(),
|
|
1942
|
-
ownerId: _zod.z.string(),
|
|
1943
|
-
// todo remove or keep to reference who created data source
|
|
1944
|
-
ownerName: _zod.z.string(),
|
|
1945
|
-
// todo probably remove
|
|
1946
|
-
scope: DataSourceFigmaScope,
|
|
1947
|
-
state: DataSourceFigmaState,
|
|
1948
|
-
requiresSync: _zod.z.boolean().optional().transform((v) => _nullishCoalesce(v, () => ( false))),
|
|
1949
|
-
lastImportMetadata: DataSourceFigmaImportMetadata.optional(),
|
|
1950
|
-
downloadChunkSize: _zod.z.number().optional(),
|
|
1951
|
-
figmaRenderChunkSize: _zod.z.number().optional(),
|
|
1952
|
-
maxFileDepth: _zod.z.number().optional()
|
|
1953
|
-
});
|
|
1954
|
-
var DataSourceTokenStudioRemote = _zod.z.object({
|
|
1955
|
-
type: _zod.z.literal(DataSourceRemoteType.Enum.TokenStudio)
|
|
1956
|
-
});
|
|
1957
|
-
var DataSourceUploadImportMetadata = _zod.z.record(_zod.z.any());
|
|
1958
|
-
var DataSourceUploadRemote = _zod.z.object({
|
|
1959
|
-
type: _zod.z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
|
|
1960
|
-
remoteId: _zod.z.string(),
|
|
1961
|
-
remoteSourceType: DataSourceUploadRemoteSource,
|
|
1962
|
-
lastImportMetadata: DataSourceUploadImportMetadata.optional(),
|
|
1963
|
-
warnings: nullishToOptional(ImportWarning.array())
|
|
1964
|
-
});
|
|
1965
|
-
var DataSourceRemote = _zod.z.discriminatedUnion("type", [
|
|
1966
|
-
DataSourceFigmaRemote,
|
|
1967
|
-
DataSourceUploadRemote,
|
|
1968
|
-
DataSourceTokenStudioRemote
|
|
1969
|
-
]);
|
|
1970
|
-
var DataSource = _zod.z.object({
|
|
1971
|
-
id: _zod.z.string(),
|
|
1972
|
-
name: _zod.z.string(),
|
|
1973
|
-
thumbnailUrl: _zod.z.string().optional(),
|
|
1974
|
-
createdAt: _zod.z.coerce.date().optional(),
|
|
1975
|
-
lastImportedAt: _zod.z.coerce.date().optional(),
|
|
1976
|
-
lastImportSummary: SourceImportSummary.optional(),
|
|
1977
|
-
designSystemId: _zod.z.string(),
|
|
1978
|
-
brandPersistentId: _zod.z.string(),
|
|
1979
|
-
autoImportMode: DataSourceAutoImportMode,
|
|
1980
|
-
stats: DataSourceStats,
|
|
1981
|
-
remote: DataSourceRemote,
|
|
1982
|
-
sortOrder: _zod.z.number()
|
|
1983
|
-
});
|
|
1984
|
-
var DataSourceVersion = _zod.z.object({
|
|
1985
|
-
id: _zod.z.string(),
|
|
1986
|
-
createdAt: _zod.z.coerce.date(),
|
|
1987
|
-
label: _zod.z.string().nullish(),
|
|
1988
|
-
description: _zod.z.string().nullish()
|
|
1989
|
-
});
|
|
1990
|
-
function zeroNumberByDefault2() {
|
|
1991
|
-
return _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( 0)));
|
|
1992
|
-
}
|
|
1993
|
-
var ImportJobState = _zod.z.enum(["PendingInput", "Queued", "InProgress", "Failed", "Success"]);
|
|
1994
|
-
var ImportJobOperation = _zod.z.enum(["Check", "Import"]);
|
|
1995
|
-
var ImportJob = Entity.extend({
|
|
1996
|
-
designSystemId: _zod.z.string(),
|
|
1997
|
-
designSystemVersionId: _zod.z.string(),
|
|
1998
|
-
sourceIds: _zod.z.array(_zod.z.string()),
|
|
1999
|
-
state: ImportJobState,
|
|
2000
|
-
createdByUserId: _zod.z.string().optional(),
|
|
2001
|
-
importContextId: _zod.z.string(),
|
|
2002
|
-
error: _zod.z.string().optional(),
|
|
2003
|
-
sourceType: DataSourceRemoteType,
|
|
2004
|
-
importContextCleanedUp: _zod.z.boolean()
|
|
2005
|
-
});
|
|
2006
|
-
var ImportFunctionInput = _zod.z.object({
|
|
2007
|
-
importJobId: _zod.z.string(),
|
|
2008
|
-
importContextId: _zod.z.string(),
|
|
2009
|
-
designSystemId: _zod.z.string().optional()
|
|
2010
|
-
});
|
|
2011
|
-
var ImportedFigmaSourceData = _zod.z.object({
|
|
2012
|
-
sourceId: _zod.z.string(),
|
|
2013
|
-
figmaRemote: DataSourceFigmaRemote
|
|
2014
|
-
});
|
|
2015
|
-
var FigmaImportBaseContext = _zod.z.object({
|
|
2016
|
-
designSystemId: _zod.z.string(),
|
|
2017
|
-
/**
|
|
2018
|
-
* Data required for accessing Figma files. This should contain access data for all file ids
|
|
2019
|
-
* mentioned in the `importedSourceDataBySourceId`
|
|
2020
|
-
*
|
|
2021
|
-
* fileId: file data
|
|
2022
|
-
*/
|
|
2023
|
-
fileAccessByFileId: _zod.z.record(FigmaFileAccessData),
|
|
2024
|
-
/**
|
|
2025
|
-
* Figma source data for which import was requested
|
|
2026
|
-
*
|
|
2027
|
-
* sourceId: source data
|
|
2028
|
-
*/
|
|
2029
|
-
importedSourceDataBySourceId: _zod.z.record(ImportedFigmaSourceData),
|
|
2030
|
-
/**
|
|
2031
|
-
* Array of warnings that will be written into the import result summary at the end
|
|
2032
|
-
* of import job execution and displayed by the client.
|
|
2033
|
-
*/
|
|
2034
|
-
importWarnings: _zod.z.record(ImportWarning.array()).default({})
|
|
2035
|
-
});
|
|
2036
|
-
var FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({
|
|
2037
|
-
sourcesWithMissingAccess: _zod.z.array(_zod.z.string()).default([]),
|
|
2038
|
-
shadowOpacityOptional: _zod.z.boolean().default(false)
|
|
2039
|
-
});
|
|
2040
|
-
var ChangedImportedFigmaSourceData = ImportedFigmaSourceData.extend({
|
|
2041
|
-
importMetadata: DataSourceFigmaImportMetadata
|
|
2042
|
-
});
|
|
2043
|
-
var FigmaImportContextWithDownloadScopes = FigmaImportContextWithSourcesState.extend({
|
|
2044
|
-
/**
|
|
2045
|
-
* Describes what to download from each file, this should contain all file id mentioned in
|
|
2046
|
-
* importMetadataBySourceId.
|
|
2047
|
-
*
|
|
2048
|
-
* File id -> file download scope
|
|
2049
|
-
*/
|
|
2050
|
-
fileDownloadScopesByFileId: _zod.z.record(FigmaFileDownloadScope),
|
|
2051
|
-
/**
|
|
2052
|
-
* Sources filtered down to the ones that have changed since last import and therefore need to be
|
|
2053
|
-
* imported again.
|
|
2054
|
-
*
|
|
2055
|
-
* Source id -> import metadata
|
|
2056
|
-
*/
|
|
2057
|
-
changedImportedSourceDataBySourceId: _zod.z.record(ChangedImportedFigmaSourceData)
|
|
2058
|
-
});
|
|
2059
|
-
var ImageImportModelType = _zod.z.enum(["Url", "FigmaRender"]);
|
|
2060
|
-
var ImageImportModelBase = _zod.z.object({
|
|
2061
|
-
scope: AssetScope
|
|
2062
|
-
});
|
|
2063
|
-
var UrlImageImportModel = ImageImportModelBase.extend({
|
|
2064
|
-
type: _zod.z.literal(ImageImportModelType.enum.Url),
|
|
2065
|
-
url: _zod.z.string(),
|
|
2066
|
-
originKey: _zod.z.string(),
|
|
2067
|
-
extension: _zod.z.string()
|
|
2068
|
-
});
|
|
2069
|
-
var FigmaRenderFormat = _zod.z.enum(["Svg", "Png", "Pdf"]);
|
|
2070
|
-
var FigmaRenderBase = ImageImportModelBase.extend({
|
|
2071
|
-
type: _zod.z.literal(ImageImportModelType.enum.FigmaRender),
|
|
2072
|
-
fileId: _zod.z.string(),
|
|
2073
|
-
fileVersionId: _zod.z.string().optional(),
|
|
2074
|
-
nodeId: _zod.z.string(),
|
|
2075
|
-
originKey: _zod.z.string()
|
|
2076
|
-
});
|
|
2077
|
-
var FigmaPngRenderImportModel = FigmaRenderBase.extend({
|
|
2078
|
-
format: _zod.z.literal(FigmaRenderFormat.enum.Png),
|
|
2079
|
-
scale: _zod.z.number()
|
|
2080
|
-
});
|
|
2081
|
-
var FigmaSvgRenderImportModel = FigmaRenderBase.extend({
|
|
2082
|
-
format: _zod.z.literal(FigmaRenderFormat.enum.Svg)
|
|
2083
|
-
});
|
|
2084
|
-
var FigmaRenderImportModel = _zod.z.discriminatedUnion("format", [
|
|
2085
|
-
FigmaPngRenderImportModel,
|
|
2086
|
-
FigmaSvgRenderImportModel
|
|
2087
|
-
]);
|
|
2088
|
-
var ImageImportModel = _zod.z.union([UrlImageImportModel, FigmaRenderImportModel]);
|
|
2089
|
-
var ImportModelBase = _zod.z.object({
|
|
2090
|
-
id: _zod.z.string(),
|
|
2091
|
-
meta: ObjectMeta,
|
|
2092
|
-
origin: DesignElementOrigin,
|
|
2093
|
-
brandPersistentId: _zod.z.string(),
|
|
2094
|
-
sortOrder: _zod.z.number()
|
|
2095
|
-
});
|
|
2096
|
-
var ImportModelInputBase = ImportModelBase.omit({
|
|
2097
|
-
brandPersistentId: true,
|
|
2098
|
-
origin: true,
|
|
2099
|
-
sortOrder: true
|
|
2100
|
-
}).extend({
|
|
2101
|
-
originId: _zod.z.string(),
|
|
2102
|
-
originMetadata: _zod.z.record(_zod.z.any())
|
|
2103
|
-
});
|
|
2104
|
-
var ComponentImportModelPart = _zod.z.object({
|
|
2105
|
-
thumbnail: ImageImportModel
|
|
2106
|
-
});
|
|
2107
|
-
var ComponentImportModel = ImportModelBase.extend(ComponentImportModelPart.shape).extend({
|
|
2108
|
-
isAsset: _zod.z.boolean(),
|
|
2109
|
-
svg: FigmaSvgRenderImportModel.optional(),
|
|
2110
|
-
origin: ComponentOrigin
|
|
2111
|
-
});
|
|
2112
|
-
var ComponentImportModelInput = ImportModelInputBase.extend(ComponentImportModelPart.shape).extend({
|
|
2113
|
-
originMetadata: ComponentOriginPart
|
|
2114
|
-
});
|
|
2115
|
-
var AssetImportModelInput = ImportModelInputBase.extend(ComponentImportModelPart.shape).extend({
|
|
2116
|
-
svg: FigmaSvgRenderImportModel,
|
|
2117
|
-
originMetadata: ComponentOriginPart
|
|
2118
|
-
});
|
|
2119
|
-
var ThemeOverrideImportModelBase = DesignTokenTypedData.and(
|
|
2120
|
-
_zod.z.object({
|
|
2121
|
-
id: _zod.z.string(),
|
|
2122
|
-
meta: ObjectMeta
|
|
2123
|
-
})
|
|
2124
|
-
);
|
|
2125
|
-
var ThemeOverrideImportModel = ThemeOverrideImportModelBase.and(
|
|
2126
|
-
_zod.z.object({
|
|
2127
|
-
origin: ThemeOverrideOrigin
|
|
2128
|
-
})
|
|
2129
|
-
);
|
|
2130
|
-
var ThemeOverrideImportModelInput = ThemeOverrideImportModelBase.and(
|
|
2131
|
-
_zod.z.object({
|
|
2132
|
-
originId: _zod.z.string(),
|
|
2133
|
-
originMetadata: ThemeOverrideOriginPart
|
|
2134
|
-
})
|
|
2135
|
-
);
|
|
2136
|
-
var ThemeImportModel = _zod.z.object({
|
|
2137
|
-
meta: ObjectMeta,
|
|
2138
|
-
brandPersistentId: _zod.z.string(),
|
|
2139
|
-
originSource: ThemeOriginSource,
|
|
2140
|
-
overrides: _zod.z.array(ThemeOverrideImportModel),
|
|
2141
|
-
sortOrder: _zod.z.number()
|
|
2142
|
-
});
|
|
2143
|
-
var ThemeImportModelInput = _zod.z.object({
|
|
2144
|
-
meta: ObjectMeta,
|
|
2145
|
-
originObjects: _zod.z.array(ThemeOriginObject),
|
|
2146
|
-
overrides: _zod.z.array(ThemeOverrideImportModelInput)
|
|
2147
|
-
});
|
|
2148
|
-
var ThemeUpdateImportModel = _zod.z.object({
|
|
2149
|
-
themePersistentId: _zod.z.string(),
|
|
2150
|
-
overrides: _zod.z.array(ThemeOverrideImportModel)
|
|
2151
|
-
});
|
|
2152
|
-
var ThemeUpdateImportModelInput = _zod.z.object({
|
|
2153
|
-
themePersistentId: _zod.z.string(),
|
|
2154
|
-
overrides: _zod.z.array(ThemeOverrideImportModelInput)
|
|
2155
|
-
});
|
|
2156
|
-
var DesignTokenImportModelPart = _zod.z.object({
|
|
2157
|
-
collection: _zod.z.string().optional(),
|
|
2158
|
-
codeSyntax: _zod.z.record(_zod.z.coerce.string()).optional()
|
|
2159
|
-
});
|
|
2160
|
-
var DesignTokenImportModelBase = ImportModelBase.extend(DesignTokenImportModelPart.shape).extend({
|
|
2161
|
-
origin: DesignTokenOrigin
|
|
2162
|
-
});
|
|
2163
|
-
var DesignTokenImportModelInputBase = ImportModelInputBase.extend(DesignTokenImportModelPart.shape).extend({
|
|
2164
|
-
originMetadata: DesignTokenOriginPart
|
|
2165
|
-
});
|
|
2166
|
-
var DesignTokenImportModel = DesignTokenTypedData.and(DesignTokenImportModelBase);
|
|
2167
|
-
var DesignTokenImportModelInput = DesignTokenTypedData.and(DesignTokenImportModelInputBase);
|
|
2168
|
-
var FigmaFileStructureNodeImportModelBase = FigmaFileStructureNodeBase.extend({
|
|
2169
|
-
image: FigmaPngRenderImportModel
|
|
2170
|
-
});
|
|
2171
|
-
var FigmaFileStructureNodeImportModel = FigmaFileStructureNodeImportModelBase.extend({
|
|
2172
|
-
children: _zod.z.lazy(() => FigmaFileStructureNodeImportModel.array())
|
|
2173
|
-
});
|
|
2174
|
-
var FigmaFileStructureImportModelPart = _zod.z.object({
|
|
2175
|
-
data: _zod.z.object({
|
|
2176
|
-
rootNode: FigmaFileStructureNodeImportModel,
|
|
2177
|
-
assetsInFile: FigmaFileStructureStatistics
|
|
2178
|
-
})
|
|
2179
|
-
});
|
|
2180
|
-
var FigmaFileStructureImportModel = ImportModelBase.extend(FigmaFileStructureImportModelPart.shape).extend({
|
|
2181
|
-
origin: FigmaFileStructureOrigin
|
|
2182
|
-
});
|
|
2183
|
-
var FigmaFileStructureImportModelInput = ImportModelInputBase.extend(
|
|
2184
|
-
FigmaFileStructureImportModelPart.shape
|
|
2185
|
-
).extend({
|
|
2186
|
-
fileVersionId: _zod.z.string()
|
|
2187
|
-
});
|
|
2188
|
-
var DataSourceImportModel = _zod.z.object({
|
|
2189
|
-
id: _zod.z.string(),
|
|
2190
|
-
fileName: _zod.z.string().optional(),
|
|
2191
|
-
thumbnailUrl: _zod.z.string().optional()
|
|
2192
|
-
});
|
|
2193
|
-
var ImportModelInputCollection = _zod.z.object({
|
|
2194
|
-
source: DataSourceImportModel,
|
|
2195
|
-
tokens: _zod.z.array(DesignTokenImportModelInput).default([]),
|
|
2196
|
-
components: _zod.z.array(ComponentImportModelInput).default([]),
|
|
2197
|
-
assets: _zod.z.array(AssetImportModelInput).default([]),
|
|
2198
|
-
themeUpdates: _zod.z.array(ThemeUpdateImportModelInput).default([]),
|
|
2199
|
-
themes: _zod.z.array(ThemeImportModelInput).default([]),
|
|
2200
|
-
figmaFileStructure: FigmaFileStructureImportModelInput.optional()
|
|
2201
|
-
});
|
|
2202
|
-
var ImportModelCollection = _zod.z.object({
|
|
2203
|
-
sources: _zod.z.array(DataSourceImportModel),
|
|
2204
|
-
tokens: _zod.z.array(DesignTokenImportModel).default([]),
|
|
2205
|
-
components: _zod.z.array(ComponentImportModel).default([]),
|
|
2206
|
-
themeUpdates: _zod.z.array(ThemeUpdateImportModel).default([]),
|
|
2207
|
-
themes: _zod.z.array(ThemeImportModel).default([]),
|
|
2208
|
-
figmaFileStructures: _zod.z.array(FigmaFileStructureImportModel)
|
|
2209
|
-
});
|
|
2210
|
-
var AssetRenderConfiguration = _zod.z.object({
|
|
2211
|
-
prefix: _zod.z.string().optional(),
|
|
2212
|
-
suffix: _zod.z.string().optional(),
|
|
2213
|
-
scale: _zod.z.number(),
|
|
2214
|
-
format: FigmaRenderFormat
|
|
2215
|
-
});
|
|
2216
|
-
var RenderedAssetFile = _zod.z.object({
|
|
2217
|
-
assetPersistentId: _zod.z.string(),
|
|
2218
|
-
assetName: _zod.z.string(),
|
|
2219
|
-
renderedImageFileName: _zod.z.string(),
|
|
2220
|
-
renderedImageUrl: _zod.z.string(),
|
|
2221
|
-
settings: AssetRenderConfiguration
|
|
2222
|
-
});
|
|
2223
|
-
var PageBlockDefinitionAppearance = _zod.z.object({
|
|
2224
|
-
isBordered: _zod.z.boolean().optional(),
|
|
2225
|
-
hasBackground: _zod.z.boolean().optional(),
|
|
2226
|
-
isEditorPresentationDifferent: _zod.z.boolean().optional(),
|
|
2227
|
-
showBlockHeaderInEditor: _zod.z.boolean().optional()
|
|
2228
|
-
});
|
|
2229
|
-
var PageBlockDefinitionLayoutType = _zod.z.enum(["Column", "Row"]);
|
|
2230
|
-
var PageBlockDefinitionLayoutGap = _zod.z.enum(["Small", "Medium", "Large", "None"]);
|
|
2231
|
-
var PageBlockDefinitionLayoutAlign = _zod.z.enum(["Start", "Center", "End"]);
|
|
2232
|
-
var PageBlockDefinitionLayoutResizing = _zod.z.enum(["Fill", "Hug"]);
|
|
2233
|
-
var PageBlockDefinitionLayoutBase = _zod.z.object({
|
|
2234
|
-
type: PageBlockDefinitionLayoutType,
|
|
2235
|
-
gap: PageBlockDefinitionLayoutGap.optional(),
|
|
2236
|
-
columnAlign: PageBlockDefinitionLayoutAlign.optional(),
|
|
2237
|
-
columnResizing: PageBlockDefinitionLayoutResizing.optional()
|
|
2238
|
-
});
|
|
2239
|
-
var PageBlockDefinitionLayout = PageBlockDefinitionLayoutBase.extend({
|
|
2240
|
-
children: _zod.z.lazy(() => _zod.z.array(PageBlockDefinitionLayout.or(_zod.z.string())))
|
|
2241
|
-
});
|
|
2242
|
-
var PageBlockDefinitionVariant = _zod.z.object({
|
|
2243
|
-
id: _zod.z.string(),
|
|
2244
|
-
name: _zod.z.string(),
|
|
2245
|
-
image: _zod.z.string().optional(),
|
|
2246
|
-
description: _zod.z.string().optional(),
|
|
2247
|
-
documentationLink: _zod.z.string().optional(),
|
|
2248
|
-
layout: PageBlockDefinitionLayout,
|
|
2249
|
-
maxColumns: _zod.z.number().optional(),
|
|
2250
|
-
defaultColumns: _zod.z.number().optional(),
|
|
2251
|
-
appearance: PageBlockDefinitionAppearance.optional()
|
|
2252
|
-
});
|
|
2253
|
-
var PageBlockDefinitionPropertyType = _zod.z.enum([
|
|
2254
|
-
"RichText",
|
|
2255
|
-
"MultiRichText",
|
|
2256
|
-
"Text",
|
|
2257
|
-
"Boolean",
|
|
2258
|
-
"Number",
|
|
2259
|
-
"SingleSelect",
|
|
2260
|
-
"MultiSelect",
|
|
2261
|
-
"Image",
|
|
2262
|
-
"Token",
|
|
2263
|
-
"TokenType",
|
|
2264
|
-
"TokenProperty",
|
|
2265
|
-
"Component",
|
|
2266
|
-
"ComponentProperty",
|
|
2267
|
-
"Asset",
|
|
2268
|
-
"AssetProperty",
|
|
2269
|
-
"FigmaNode",
|
|
2270
|
-
"EmbedURL",
|
|
2271
|
-
"URL",
|
|
2272
|
-
"Markdown",
|
|
2273
|
-
"Code",
|
|
2274
|
-
"CodeSandbox",
|
|
2275
|
-
"Table",
|
|
2276
|
-
"Divider",
|
|
2277
|
-
"Storybook",
|
|
2278
|
-
"Color",
|
|
2279
|
-
"FigmaComponent"
|
|
2280
|
-
]);
|
|
2281
|
-
var PageBlockDefinitionRichTextPropertyStyle = _zod.z.enum([
|
|
2282
|
-
"Title1",
|
|
2283
|
-
"Title2",
|
|
2284
|
-
"Title3",
|
|
2285
|
-
"Title4",
|
|
2286
|
-
"Title5",
|
|
2287
|
-
"Quote",
|
|
2288
|
-
"Callout",
|
|
2289
|
-
"Default"
|
|
2290
|
-
]);
|
|
2291
|
-
var PageBlockDefinitionMultiRichTextPropertyStyle = _zod.z.enum(["OL", "UL", "Default"]);
|
|
2292
|
-
var PageBlockDefinitionTextPropertyStyle = _zod.z.enum([
|
|
2293
|
-
"Title1",
|
|
2294
|
-
"Title2",
|
|
2295
|
-
"Title3",
|
|
2296
|
-
"Title4",
|
|
2297
|
-
"Title5",
|
|
2298
|
-
"Default",
|
|
2299
|
-
"DefaultBold",
|
|
2300
|
-
"DefaultSemibold",
|
|
2301
|
-
"Small",
|
|
2302
|
-
"SmallBold",
|
|
2303
|
-
"SmallSemibold",
|
|
2304
|
-
"Custom"
|
|
2305
|
-
]);
|
|
2306
|
-
var PageBlockDefinitionTextPropertyColor = _zod.z.enum(["Neutral", "NeutralFaded"]);
|
|
2307
|
-
var PageBlockDefinitionBooleanPropertyStyle = _zod.z.enum(["SegmentedControl", "ToggleButton", "Checkbox"]);
|
|
2308
|
-
var PageBlockDefinitionSingleSelectPropertyStyle = _zod.z.enum([
|
|
2309
|
-
"SegmentedControl",
|
|
2310
|
-
"ToggleButton",
|
|
2311
|
-
"Select",
|
|
2312
|
-
"Checkbox"
|
|
2313
|
-
]);
|
|
2314
|
-
var PageBlockDefinitionSingleSelectPropertyColor = _zod.z.enum([
|
|
2315
|
-
"Green",
|
|
2316
|
-
"Red",
|
|
2317
|
-
"Yellow",
|
|
2318
|
-
"Blue",
|
|
2319
|
-
"Purple",
|
|
2320
|
-
"Orange",
|
|
2321
|
-
"Pink",
|
|
2322
|
-
"Teal",
|
|
2323
|
-
"Brown",
|
|
2324
|
-
"Grey",
|
|
2325
|
-
"LightGrey",
|
|
2326
|
-
"Cyan",
|
|
2327
|
-
"Fuchsia"
|
|
2328
|
-
]);
|
|
2329
|
-
var IconSet = _zod.z.enum([
|
|
2330
|
-
"CheckCircle",
|
|
2331
|
-
"CrossCircle",
|
|
2332
|
-
"Alert"
|
|
2333
|
-
]);
|
|
2334
|
-
var PageBlockDefinitionMultiSelectPropertyStyle = _zod.z.enum(["SegmentedControl", "Select", "Checkbox"]);
|
|
2335
|
-
var PageBlockDefinitionImageAspectRatio = _zod.z.enum(["Auto", "Square", "Landscape", "Portrait", "Wide"]);
|
|
2336
|
-
var PageBlockDefinitionImageWidth = _zod.z.enum(["Full", "Icon", "Small", "Medium", "Large", "Poster"]);
|
|
2337
|
-
var PageBlockDefinitionSelectChoice = _zod.z.object({
|
|
2338
|
-
value: _zod.z.string(),
|
|
2339
|
-
name: _zod.z.string(),
|
|
2340
|
-
icon: IconSet.optional(),
|
|
2341
|
-
customIconUrl: _zod.z.string().optional(),
|
|
2342
|
-
color: PageBlockDefinitionSingleSelectPropertyColor.optional()
|
|
2343
|
-
});
|
|
2344
|
-
var PageBlockDefinitionUntypedPropertyOptions = _zod.z.record(_zod.z.any());
|
|
2345
|
-
var PageBlockDefinitionRichTextOptions = _zod.z.object({
|
|
2346
|
-
richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional()
|
|
2347
|
-
});
|
|
2348
|
-
var PageBlockDefinitionMutiRichTextOptions = _zod.z.object({
|
|
2349
|
-
multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional()
|
|
2350
|
-
});
|
|
2351
|
-
var PageBlockDefinitionTextOptions = _zod.z.object({
|
|
2352
|
-
placeholder: _zod.z.string().optional(),
|
|
2353
|
-
defaultValue: _zod.z.string().optional(),
|
|
2354
|
-
textStyle: PageBlockDefinitionTextPropertyStyle.optional(),
|
|
2355
|
-
color: PageBlockDefinitionTextPropertyColor.optional(),
|
|
2356
|
-
allowLineBreaks: _zod.z.boolean().optional()
|
|
2357
|
-
});
|
|
2358
|
-
var PageBlockDefinitionSelectOptions = _zod.z.object({
|
|
2359
|
-
singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),
|
|
2360
|
-
defaultChoice: _zod.z.string(),
|
|
2361
|
-
choices: _zod.z.array(PageBlockDefinitionSelectChoice)
|
|
2362
|
-
});
|
|
2363
|
-
var PageBlockDefinitionImageOptions = _zod.z.object({
|
|
2364
|
-
width: PageBlockDefinitionImageWidth.optional(),
|
|
2365
|
-
aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),
|
|
2366
|
-
allowCaption: _zod.z.boolean().optional(),
|
|
2367
|
-
recommendation: _zod.z.string().optional()
|
|
2368
|
-
});
|
|
2369
|
-
var PageBlockDefinitionBooleanOptions = _zod.z.object({
|
|
2370
|
-
defaultvalue: _zod.z.boolean().optional(),
|
|
2371
|
-
booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional()
|
|
2372
|
-
});
|
|
2373
|
-
var PageBlockDefinitionNumberOptions = _zod.z.object({
|
|
2374
|
-
defaultValue: _zod.z.number(),
|
|
2375
|
-
min: _zod.z.number().optional(),
|
|
2376
|
-
max: _zod.z.number().optional(),
|
|
2377
|
-
step: _zod.z.number().optional(),
|
|
2378
|
-
placeholder: _zod.z.string().optional()
|
|
2379
|
-
});
|
|
2380
|
-
var PageBlockDefinitionComponentOptions = _zod.z.object({
|
|
2381
|
-
renderLayoutAs: _zod.z.enum(["List", "Table"]).optional(),
|
|
2382
|
-
allowPropertySelection: _zod.z.boolean().optional()
|
|
2383
|
-
});
|
|
2384
|
-
var PageBlockDefinitionProperty = _zod.z.object({
|
|
2385
|
-
id: _zod.z.string(),
|
|
2386
|
-
name: _zod.z.string(),
|
|
2387
|
-
type: PageBlockDefinitionPropertyType,
|
|
2388
|
-
description: _zod.z.string().optional(),
|
|
2389
|
-
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
2390
|
-
variantOptions: _zod.z.record(PageBlockDefinitionUntypedPropertyOptions).optional()
|
|
2391
|
-
});
|
|
2392
|
-
var PageBlockDefinitionItem = _zod.z.object({
|
|
2393
|
-
properties: _zod.z.array(PageBlockDefinitionProperty),
|
|
2394
|
-
appearance: PageBlockDefinitionAppearance.optional(),
|
|
2395
|
-
variants: _zod.z.array(PageBlockDefinitionVariant),
|
|
2396
|
-
defaultVariantKey: _zod.z.string()
|
|
2397
|
-
});
|
|
2398
|
-
var PageBlockCategory = _zod.z.enum([
|
|
2399
|
-
"Text",
|
|
2400
|
-
"Layout",
|
|
2401
|
-
"Media",
|
|
2402
|
-
"Embed",
|
|
2403
|
-
"Figma",
|
|
2404
|
-
"Code",
|
|
2405
|
-
"Guidelines",
|
|
2406
|
-
"Tokens",
|
|
2407
|
-
"Components",
|
|
2408
|
-
"Assets",
|
|
2409
|
-
"Data",
|
|
2410
|
-
"Other"
|
|
2411
|
-
]);
|
|
2412
|
-
var PageBlockBehaviorDataType = _zod.z.enum(["Item", "Token", "Asset", "Component", "FigmaNode", "FigmaComponent"]);
|
|
2413
|
-
var PageBlockBehaviorSelectionType = _zod.z.enum(["Entity", "Group", "EntityAndGroup"]);
|
|
2414
|
-
var PageBlockDefinitionBehavior = _zod.z.object({
|
|
2415
|
-
dataType: PageBlockBehaviorDataType,
|
|
2416
|
-
items: _zod.z.object({
|
|
2417
|
-
numberOfItems: _zod.z.number(),
|
|
2418
|
-
allowLinks: _zod.z.boolean(),
|
|
2419
|
-
newItemLabel: _zod.z.string().optional()
|
|
2420
|
-
}).optional(),
|
|
2421
|
-
entities: _zod.z.object({
|
|
2422
|
-
selectionType: PageBlockBehaviorSelectionType,
|
|
2423
|
-
maxSelected: _zod.z.number()
|
|
2424
|
-
}).optional()
|
|
2425
|
-
});
|
|
2426
|
-
var PageBlockDefinitionOnboarding = _zod.z.object({
|
|
2427
|
-
helpText: _zod.z.string(),
|
|
2428
|
-
documentationLink: _zod.z.string().optional()
|
|
2429
|
-
});
|
|
2430
|
-
var PageBlockDefinition = _zod.z.object({
|
|
2431
|
-
id: _zod.z.string(),
|
|
2432
|
-
name: _zod.z.string(),
|
|
2433
|
-
description: _zod.z.string(),
|
|
2434
|
-
category: PageBlockCategory,
|
|
2435
|
-
icon: _zod.z.string().optional(),
|
|
2436
|
-
documentationLink: _zod.z.string().optional(),
|
|
2437
|
-
searchKeywords: _zod.z.array(_zod.z.string()).optional(),
|
|
2438
|
-
item: PageBlockDefinitionItem,
|
|
2439
|
-
behavior: PageBlockDefinitionBehavior,
|
|
2440
|
-
editorOptions: _zod.z.object({
|
|
2441
|
-
onboarding: PageBlockDefinitionOnboarding.optional(),
|
|
2442
|
-
newItemLabel: _zod.z.string().optional()
|
|
2443
|
-
}),
|
|
2444
|
-
appearance: PageBlockDefinitionAppearance.optional()
|
|
2445
|
-
});
|
|
2446
|
-
var DocumentationPageGroup = _zod.z.object({
|
|
2447
|
-
type: _zod.z.literal("ElementGroup"),
|
|
2448
|
-
childType: _zod.z.literal("DocumentationPage"),
|
|
2449
|
-
id: _zod.z.string(),
|
|
2450
|
-
persistentId: _zod.z.string(),
|
|
2451
|
-
shortPersistentId: _zod.z.string(),
|
|
2452
|
-
designSystemVersionId: _zod.z.string(),
|
|
2453
|
-
parentPersistentId: _zod.z.string().nullish(),
|
|
2454
|
-
sortOrder: _zod.z.number(),
|
|
2455
|
-
title: _zod.z.string(),
|
|
2456
|
-
slug: _zod.z.string(),
|
|
2457
|
-
userSlug: _zod.z.string().nullish(),
|
|
2458
|
-
createdAt: _zod.z.coerce.date(),
|
|
2459
|
-
updatedAt: _zod.z.coerce.date()
|
|
2460
|
-
});
|
|
2461
|
-
var DocumentationLinkPreview = _zod.z.object({
|
|
2462
|
-
title: _zod.z.string().optional(),
|
|
2463
|
-
description: _zod.z.string().optional(),
|
|
2464
|
-
thumbnail: PageBlockImageReference.optional()
|
|
2465
|
-
});
|
|
2466
|
-
var DocumentationPageAnchor = _zod.z.object({
|
|
2467
|
-
blockId: _zod.z.string(),
|
|
2468
|
-
level: _zod.z.number(),
|
|
2469
|
-
text: _zod.z.string()
|
|
2470
|
-
});
|
|
2471
|
-
var DocumentationPageContentBackup = _zod.z.object({
|
|
2472
|
-
id: _zod.z.string(),
|
|
2473
|
-
designSystemVersionId: _zod.z.string(),
|
|
2474
|
-
createdAt: _zod.z.coerce.date(),
|
|
2475
|
-
updatedAt: _zod.z.coerce.date(),
|
|
2476
|
-
documentationPageId: _zod.z.string(),
|
|
2477
|
-
documentationPageName: _zod.z.string(),
|
|
2478
|
-
storagePath: _zod.z.string()
|
|
2479
|
-
});
|
|
2480
|
-
var DocumentationPageContentItem = _zod.z.discriminatedUnion("type", [
|
|
2481
|
-
PageBlockEditorModelV2,
|
|
2482
|
-
PageSectionEditorModelV2
|
|
2483
|
-
]);
|
|
2484
|
-
var DocumentationPageContentData = _zod.z.object({
|
|
2485
|
-
items: _zod.z.array(DocumentationPageContentItem)
|
|
2486
|
-
});
|
|
2487
|
-
var DocumentationPageContent = _zod.z.object({
|
|
2488
|
-
id: _zod.z.string(),
|
|
2489
|
-
designSystemVersionId: _zod.z.string(),
|
|
2490
|
-
createdAt: _zod.z.coerce.date(),
|
|
2491
|
-
updatedAt: _zod.z.coerce.date(),
|
|
2492
|
-
documentationPageId: _zod.z.string(),
|
|
2493
|
-
data: DocumentationPageContentData
|
|
2494
|
-
});
|
|
2495
|
-
var DocumentationPage = _zod.z.object({
|
|
2496
|
-
type: _zod.z.literal("DocumentationPage"),
|
|
2497
|
-
id: _zod.z.string(),
|
|
2498
|
-
persistentId: _zod.z.string(),
|
|
2499
|
-
shortPersistentId: _zod.z.string(),
|
|
2500
|
-
designSystemVersionId: _zod.z.string(),
|
|
2501
|
-
parentPersistentId: _zod.z.string().nullish(),
|
|
2502
|
-
sortOrder: _zod.z.number(),
|
|
2503
|
-
title: _zod.z.string(),
|
|
2504
|
-
slug: _zod.z.string(),
|
|
2505
|
-
userSlug: _zod.z.string().nullish(),
|
|
2506
|
-
createdAt: _zod.z.coerce.date(),
|
|
2507
|
-
updatedAt: _zod.z.coerce.date()
|
|
2508
|
-
});
|
|
2509
|
-
var DocumentationComment = _zod.z.object({
|
|
2510
|
-
id: _zod.z.string(),
|
|
2511
|
-
authorId: _zod.z.string(),
|
|
2512
|
-
threadId: _zod.z.string(),
|
|
2513
|
-
roomId: _zod.z.string(),
|
|
2514
|
-
createdAt: _zod.z.coerce.date(),
|
|
2515
|
-
editedAt: _zod.z.coerce.date().optional(),
|
|
2516
|
-
deletedAt: _zod.z.coerce.date().optional(),
|
|
2517
|
-
body: _zod.z.string()
|
|
2518
|
-
});
|
|
2519
|
-
var DocumentationCommentThread = _zod.z.object({
|
|
2520
|
-
id: _zod.z.string(),
|
|
2521
|
-
roomId: _zod.z.string(),
|
|
2522
|
-
pagePersistentId: _zod.z.string(),
|
|
2523
|
-
brandId: _zod.z.string(),
|
|
2524
|
-
designSystemVersionId: _zod.z.string(),
|
|
2525
|
-
designSystemId: _zod.z.string(),
|
|
2526
|
-
blockId: _zod.z.string().optional(),
|
|
2527
|
-
resolved: _zod.z.boolean(),
|
|
2528
|
-
createdAt: _zod.z.coerce.date(),
|
|
2529
|
-
updatedAt: _zod.z.coerce.date()
|
|
2530
|
-
});
|
|
2531
|
-
var SupernovaException = class _SupernovaException extends Error {
|
|
2532
|
-
//
|
|
2533
|
-
// Properties
|
|
2534
|
-
//
|
|
2535
|
-
constructor(type, message) {
|
|
2536
|
-
super(`${type}: ${message}`);
|
|
2537
|
-
this.type = type;
|
|
2538
|
-
}
|
|
2539
|
-
static wrongFormat(message) {
|
|
2540
|
-
return new _SupernovaException("WrongFormat", message);
|
|
2541
|
-
}
|
|
2542
|
-
static validationError(message) {
|
|
2543
|
-
return new _SupernovaException("ValidationError", message);
|
|
2544
|
-
}
|
|
2545
|
-
static accessDenied(message) {
|
|
2546
|
-
return new _SupernovaException("AccessDenied", message);
|
|
2547
|
-
}
|
|
2548
|
-
static tooMuchWork(message) {
|
|
2549
|
-
return new _SupernovaException("TooMuchWork", message);
|
|
2550
|
-
}
|
|
2551
|
-
static notFound(message) {
|
|
2552
|
-
return new _SupernovaException("ResourceNotFound", message);
|
|
2553
|
-
}
|
|
2554
|
-
static timeout(message) {
|
|
2555
|
-
return new _SupernovaException("Timeout", message);
|
|
2556
|
-
}
|
|
2557
|
-
static conflict(message) {
|
|
2558
|
-
return new _SupernovaException("Conflict", message);
|
|
2559
|
-
}
|
|
2560
|
-
static notImplemented(message) {
|
|
2561
|
-
return new _SupernovaException("NotImplemented", message);
|
|
2562
|
-
}
|
|
2563
|
-
static wrongActionOrder(message) {
|
|
2564
|
-
return new _SupernovaException("WrongActionOrder", message);
|
|
2565
|
-
}
|
|
2566
|
-
static invalidOperation(message) {
|
|
2567
|
-
return new _SupernovaException("InvalidOperation", message);
|
|
2568
|
-
}
|
|
2569
|
-
static shouldNotHappen(message) {
|
|
2570
|
-
return new _SupernovaException("UnexpectedError", message);
|
|
2571
|
-
}
|
|
2572
|
-
static ipRestricted(message) {
|
|
2573
|
-
return new _SupernovaException("IPRestricted", message);
|
|
2574
|
-
}
|
|
2575
|
-
static planRestricted(message) {
|
|
2576
|
-
return new _SupernovaException("PlanRestricted", message);
|
|
2577
|
-
}
|
|
2578
|
-
static missingWorkspacePermission(message) {
|
|
2579
|
-
return new _SupernovaException("MissingWorkspacePermission", message);
|
|
2580
|
-
}
|
|
2581
|
-
static missingExporterPermission(message) {
|
|
2582
|
-
return new _SupernovaException("MissingExporterPermission", message);
|
|
2583
|
-
}
|
|
2584
|
-
static missingIntegration(message) {
|
|
2585
|
-
return new _SupernovaException("MissingIntegration", message);
|
|
2586
|
-
}
|
|
2587
|
-
static missingIntegrationAccess(message) {
|
|
2588
|
-
return new _SupernovaException("MissingIntegrationAccess", message);
|
|
2589
|
-
}
|
|
2590
|
-
static noAccess(message) {
|
|
2591
|
-
return new _SupernovaException("NoAccess", message);
|
|
2592
|
-
}
|
|
2593
|
-
static missingCredentials(message) {
|
|
2594
|
-
return new _SupernovaException("MissingCredentials", message);
|
|
2595
|
-
}
|
|
2596
|
-
static thirdPartyError(message) {
|
|
2597
|
-
return new _SupernovaException("ThirdPartyError", message);
|
|
2598
|
-
}
|
|
2599
|
-
//
|
|
2600
|
-
// To refactor
|
|
2601
|
-
//
|
|
2602
|
-
static badRequest(message) {
|
|
2603
|
-
return new _SupernovaException("BadRequest", message);
|
|
2604
|
-
}
|
|
2605
|
-
};
|
|
2606
|
-
function tryParseUrl(url) {
|
|
2607
|
-
try {
|
|
2608
|
-
return parseUrl(url);
|
|
2609
|
-
} catch (e) {
|
|
2610
|
-
console.error(`Error parsing URL ${url}`);
|
|
2611
|
-
console.error(e);
|
|
2612
|
-
return null;
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
function parseUrl(url) {
|
|
2616
|
-
return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
|
|
2617
|
-
}
|
|
2618
|
-
function mapByUnique(items, keyFn) {
|
|
2619
|
-
const result = /* @__PURE__ */ new Map();
|
|
2620
|
-
for (const item of items) {
|
|
2621
|
-
result.set(keyFn(item), item);
|
|
2622
|
-
}
|
|
2623
|
-
return result;
|
|
2624
|
-
}
|
|
2625
|
-
function groupBy(items, keyFn) {
|
|
2626
|
-
const result = /* @__PURE__ */ new Map();
|
|
2627
|
-
for (const item of items) {
|
|
2628
|
-
const key = keyFn(item);
|
|
2629
|
-
const array = result.get(key);
|
|
2630
|
-
if (array) {
|
|
2631
|
-
array.push(item);
|
|
2632
|
-
} else {
|
|
2633
|
-
result.set(key, [item]);
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
return result;
|
|
2637
|
-
}
|
|
2638
|
-
var ContentLoadInstruction = _zod.z.object({
|
|
2639
|
-
from: _zod.z.string(),
|
|
2640
|
-
to: _zod.z.string(),
|
|
2641
|
-
authorizationHeaderKvsId: _zod.z.string().optional(),
|
|
2642
|
-
timeout: _zod.z.number().optional()
|
|
2643
|
-
});
|
|
2644
|
-
var ContentLoaderPayload = _zod.z.object({
|
|
2645
|
-
type: _zod.z.literal("Single"),
|
|
2646
|
-
instruction: ContentLoadInstruction
|
|
2647
|
-
}).or(
|
|
2648
|
-
_zod.z.object({
|
|
2649
|
-
type: _zod.z.literal("Multiple"),
|
|
2650
|
-
loadingChunkSize: _zod.z.number().optional(),
|
|
2651
|
-
instructions: _zod.z.array(ContentLoadInstruction)
|
|
2652
|
-
})
|
|
2653
|
-
).or(
|
|
2654
|
-
_zod.z.object({
|
|
2655
|
-
type: _zod.z.literal("S3"),
|
|
2656
|
-
location: _zod.z.string()
|
|
2657
|
-
})
|
|
768
|
+
var ContentLoaderPayload = _zod.z.object({
|
|
769
|
+
type: _zod.z.literal("Single"),
|
|
770
|
+
instruction: ContentLoadInstruction
|
|
771
|
+
}).or(
|
|
772
|
+
_zod.z.object({
|
|
773
|
+
type: _zod.z.literal("Multiple"),
|
|
774
|
+
loadingChunkSize: _zod.z.number().optional(),
|
|
775
|
+
instructions: _zod.z.array(ContentLoadInstruction)
|
|
776
|
+
})
|
|
777
|
+
).or(
|
|
778
|
+
_zod.z.object({
|
|
779
|
+
type: _zod.z.literal("S3"),
|
|
780
|
+
location: _zod.z.string()
|
|
781
|
+
})
|
|
2658
782
|
);
|
|
2659
783
|
function slugify(str, options) {
|
|
2660
784
|
const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
|
|
@@ -3281,6 +1405,2033 @@ var RESERVED_SLUGS = [
|
|
|
3281
1405
|
];
|
|
3282
1406
|
var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
|
|
3283
1407
|
var slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
1408
|
+
var ElementPropertyTypeSchema = _zod.z.enum(["Text", "Number", "Boolean", "Select", "Generic", "Link", "URL"]);
|
|
1409
|
+
var ElementPropertyTargetType = _zod.z.enum(["Token", "Component", "DocumentationPage"]);
|
|
1410
|
+
var ElementPropertyLinkType = _zod.z.enum(["FigmaComponent", "DocumentationPage"]);
|
|
1411
|
+
var CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
|
|
1412
|
+
var ColorTokenInlineData = _zod.z.object({
|
|
1413
|
+
value: _zod.z.string()
|
|
1414
|
+
});
|
|
1415
|
+
var ElementPropertyDefinitionOption = _zod.z.object({
|
|
1416
|
+
id: _zod.z.string(),
|
|
1417
|
+
name: _zod.z.string(),
|
|
1418
|
+
backgroundColor: ColorTokenInlineData.optional()
|
|
1419
|
+
});
|
|
1420
|
+
var ElementPropertyDefinition = _zod.z.object({
|
|
1421
|
+
id: _zod.z.string(),
|
|
1422
|
+
designSystemVersionId: _zod.z.string(),
|
|
1423
|
+
persistentId: _zod.z.string(),
|
|
1424
|
+
name: _zod.z.string(),
|
|
1425
|
+
codeName: _zod.z.string().regex(CODE_NAME_REGEX),
|
|
1426
|
+
description: _zod.z.string(),
|
|
1427
|
+
type: ElementPropertyTypeSchema,
|
|
1428
|
+
targetElementType: ElementPropertyTargetType,
|
|
1429
|
+
options: _zod.z.array(ElementPropertyDefinitionOption).optional(),
|
|
1430
|
+
linkElementType: ElementPropertyLinkType.optional()
|
|
1431
|
+
});
|
|
1432
|
+
var ElementPropertyType = ElementPropertyTypeSchema.enum;
|
|
1433
|
+
var ElementPropertyValue = _zod.z.object({
|
|
1434
|
+
id: _zod.z.string(),
|
|
1435
|
+
designSystemVersionId: _zod.z.string(),
|
|
1436
|
+
targetElementPersistentId: _zod.z.string(),
|
|
1437
|
+
definitionPersistentId: _zod.z.string(),
|
|
1438
|
+
stringValue: _zod.z.string().nullish(),
|
|
1439
|
+
numberValue: _zod.z.number().nullish(),
|
|
1440
|
+
booleanValue: _zod.z.boolean().nullish(),
|
|
1441
|
+
referenceValue: _zod.z.string().nullish(),
|
|
1442
|
+
referenceValuePreview: _zod.z.string().optional()
|
|
1443
|
+
});
|
|
1444
|
+
var Point2D = _zod.z.object({
|
|
1445
|
+
x: _zod.z.number(),
|
|
1446
|
+
y: _zod.z.number()
|
|
1447
|
+
});
|
|
1448
|
+
var nullSize = { height: -1, width: -1 };
|
|
1449
|
+
function isNullSize(size) {
|
|
1450
|
+
return size.height === nullSize.height && size.width === nullSize.width;
|
|
1451
|
+
}
|
|
1452
|
+
var Size = _zod.z.object({
|
|
1453
|
+
width: _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( nullSize.width))),
|
|
1454
|
+
height: _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( nullSize.height)))
|
|
1455
|
+
});
|
|
1456
|
+
var SizeOrUndefined = Size.optional().transform((v) => {
|
|
1457
|
+
if (!v)
|
|
1458
|
+
return void 0;
|
|
1459
|
+
if (isNullSize(v))
|
|
1460
|
+
return void 0;
|
|
1461
|
+
return v;
|
|
1462
|
+
});
|
|
1463
|
+
var DesignTokenType = _zod.z.enum([
|
|
1464
|
+
"Color",
|
|
1465
|
+
"Border",
|
|
1466
|
+
"Gradient",
|
|
1467
|
+
"Shadow",
|
|
1468
|
+
"Dimension",
|
|
1469
|
+
"Duration",
|
|
1470
|
+
"Size",
|
|
1471
|
+
"Space",
|
|
1472
|
+
"Opacity",
|
|
1473
|
+
"FontSize",
|
|
1474
|
+
"LineHeight",
|
|
1475
|
+
"LetterSpacing",
|
|
1476
|
+
"ParagraphSpacing",
|
|
1477
|
+
"BorderWidth",
|
|
1478
|
+
"BorderRadius",
|
|
1479
|
+
"Duration",
|
|
1480
|
+
"ZIndex",
|
|
1481
|
+
"Image",
|
|
1482
|
+
"String",
|
|
1483
|
+
"ProductCopy",
|
|
1484
|
+
"FontFamily",
|
|
1485
|
+
"FontWeight",
|
|
1486
|
+
"TextDecoration",
|
|
1487
|
+
"TextCase",
|
|
1488
|
+
"Visibility",
|
|
1489
|
+
"Typography",
|
|
1490
|
+
"Blur",
|
|
1491
|
+
"Font"
|
|
1492
|
+
]);
|
|
1493
|
+
var tokenElementTypes = [...DesignTokenType.options.filter((v) => v !== "Font")];
|
|
1494
|
+
var DesignElementType = DesignTokenType.or(
|
|
1495
|
+
_zod.z.enum([
|
|
1496
|
+
"Component",
|
|
1497
|
+
"Theme",
|
|
1498
|
+
"Documentation",
|
|
1499
|
+
"DocumentationPage",
|
|
1500
|
+
"DesignSystemComponent",
|
|
1501
|
+
"ElementGroup",
|
|
1502
|
+
"FigmaNodeStructure",
|
|
1503
|
+
"FigmaNodeReference",
|
|
1504
|
+
"PageBlock"
|
|
1505
|
+
])
|
|
1506
|
+
);
|
|
1507
|
+
var DesignElementCategory = _zod.z.enum([
|
|
1508
|
+
"Token",
|
|
1509
|
+
"Component",
|
|
1510
|
+
"DesignSystemComponent",
|
|
1511
|
+
"DocumentationPage",
|
|
1512
|
+
"Theme",
|
|
1513
|
+
"PageBlock"
|
|
1514
|
+
]);
|
|
1515
|
+
var DesignSystemElementExportProps = _zod.z.object({
|
|
1516
|
+
isAsset: _zod.z.boolean().nullish().transform((v) => _nullishCoalesce(v, () => ( false))),
|
|
1517
|
+
codeName: _zod.z.string().nullish()
|
|
1518
|
+
});
|
|
1519
|
+
var ShallowDesignElement = _zod.z.object({
|
|
1520
|
+
id: _zod.z.string(),
|
|
1521
|
+
persistentId: _zod.z.string(),
|
|
1522
|
+
designSystemVersionId: _zod.z.string(),
|
|
1523
|
+
type: DesignElementType,
|
|
1524
|
+
brandPersistentId: _zod.z.string().optional(),
|
|
1525
|
+
parentPersistentId: _zod.z.string().optional(),
|
|
1526
|
+
shortPersistentId: _zod.z.string().optional(),
|
|
1527
|
+
childType: DesignElementType.optional(),
|
|
1528
|
+
sortOrder: _zod.z.number(),
|
|
1529
|
+
origin: _zod.z.record(_zod.z.any()).optional(),
|
|
1530
|
+
createdAt: _zod.z.coerce.date(),
|
|
1531
|
+
updatedAt: _zod.z.coerce.date()
|
|
1532
|
+
});
|
|
1533
|
+
var DesignElement = ShallowDesignElement.extend({
|
|
1534
|
+
meta: ObjectMeta,
|
|
1535
|
+
slug: _zod.z.string().optional(),
|
|
1536
|
+
userSlug: _zod.z.string().optional(),
|
|
1537
|
+
exportProperties: DesignSystemElementExportProps.optional(),
|
|
1538
|
+
data: _zod.z.record(_zod.z.any()),
|
|
1539
|
+
origin: _zod.z.record(_zod.z.any()).optional()
|
|
1540
|
+
});
|
|
1541
|
+
var HierarchicalElements = DesignTokenType.or(
|
|
1542
|
+
_zod.z.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
|
|
1543
|
+
);
|
|
1544
|
+
var PageBlockCalloutType = _zod.z.enum(["Info", "Primary", "Success", "Warning", "Error"]);
|
|
1545
|
+
var PageBlockTypeV1 = _zod.z.enum([
|
|
1546
|
+
"Text",
|
|
1547
|
+
"Heading",
|
|
1548
|
+
"Code",
|
|
1549
|
+
"UnorderedList",
|
|
1550
|
+
"OrderedList",
|
|
1551
|
+
"Quote",
|
|
1552
|
+
"Callout",
|
|
1553
|
+
"Divider",
|
|
1554
|
+
"Image",
|
|
1555
|
+
"Embed",
|
|
1556
|
+
"Link",
|
|
1557
|
+
"Shortcuts",
|
|
1558
|
+
"FigmaEmbed",
|
|
1559
|
+
"YoutubeEmbed",
|
|
1560
|
+
"StorybookEmbed",
|
|
1561
|
+
"Token",
|
|
1562
|
+
"TokenGroup",
|
|
1563
|
+
"TokenList",
|
|
1564
|
+
"Component",
|
|
1565
|
+
"ComponentGroup",
|
|
1566
|
+
"Theme",
|
|
1567
|
+
"ComponentSandbox",
|
|
1568
|
+
"Custom",
|
|
1569
|
+
"FigmaFrames",
|
|
1570
|
+
"ComponentAssets",
|
|
1571
|
+
"RenderCode",
|
|
1572
|
+
"Tabs",
|
|
1573
|
+
"TabItem",
|
|
1574
|
+
"Table",
|
|
1575
|
+
"TableRow",
|
|
1576
|
+
"TableCell",
|
|
1577
|
+
"Guidelines"
|
|
1578
|
+
]);
|
|
1579
|
+
var PageBlockCodeLanguage = _zod.z.enum([
|
|
1580
|
+
"Angular",
|
|
1581
|
+
"Bash",
|
|
1582
|
+
"C",
|
|
1583
|
+
"Cpp",
|
|
1584
|
+
"Csharp",
|
|
1585
|
+
"CSS",
|
|
1586
|
+
"Dart",
|
|
1587
|
+
"Handlebars",
|
|
1588
|
+
"HTML",
|
|
1589
|
+
"Java",
|
|
1590
|
+
"Javascript",
|
|
1591
|
+
"JSON",
|
|
1592
|
+
"ReactJSX",
|
|
1593
|
+
"ReactTSX",
|
|
1594
|
+
"Kotlin",
|
|
1595
|
+
"Lua",
|
|
1596
|
+
"Markdown",
|
|
1597
|
+
"ObjectiveC",
|
|
1598
|
+
"PHP",
|
|
1599
|
+
"Plain",
|
|
1600
|
+
"Python",
|
|
1601
|
+
"Ruby",
|
|
1602
|
+
"Rust",
|
|
1603
|
+
"Sass",
|
|
1604
|
+
"SCSS",
|
|
1605
|
+
"Svetle",
|
|
1606
|
+
"Swift",
|
|
1607
|
+
"Twig",
|
|
1608
|
+
"Typescript",
|
|
1609
|
+
"Vue",
|
|
1610
|
+
"XML",
|
|
1611
|
+
"YAML"
|
|
1612
|
+
]);
|
|
1613
|
+
var PageBlockAlignment = _zod.z.enum(["Left", "Center", "Stretch", "Right"]);
|
|
1614
|
+
var PageBlockThemeType = _zod.z.enum(["Override", "Comparison"]);
|
|
1615
|
+
var PageBlockAssetType = _zod.z.enum(["image", "figmaFrame"]);
|
|
1616
|
+
var PageBlockTilesAlignment = _zod.z.enum(["Center", "FrameHeight"]);
|
|
1617
|
+
var PageBlockTilesLayout = _zod.z.enum(["C8", "C7", "C6", "C5", "C4", "C3", "C2", "C1", "C1_75"]);
|
|
1618
|
+
var PageBlockTheme = _zod.z.object({
|
|
1619
|
+
themeIds: _zod.z.array(_zod.z.string()),
|
|
1620
|
+
type: PageBlockThemeType
|
|
1621
|
+
});
|
|
1622
|
+
var PageBlockUrlPreview = _zod.z.object({
|
|
1623
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1624
|
+
description: nullishToOptional(_zod.z.string()),
|
|
1625
|
+
thumbnailUrl: nullishToOptional(_zod.z.string())
|
|
1626
|
+
});
|
|
1627
|
+
var PageBlockFrameOrigin = _zod.z.object({
|
|
1628
|
+
sourceFileName: nullishToOptional(_zod.z.string()),
|
|
1629
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1630
|
+
previewUrl: nullishToOptional(_zod.z.string()),
|
|
1631
|
+
valid: nullishToOptional(_zod.z.boolean()),
|
|
1632
|
+
referenceId: nullishToOptional(_zod.z.string()),
|
|
1633
|
+
assetId: nullishToOptional(_zod.z.string()),
|
|
1634
|
+
assetScale: nullishToOptional(_zod.z.number()),
|
|
1635
|
+
width: nullishToOptional(_zod.z.number()),
|
|
1636
|
+
height: nullishToOptional(_zod.z.number())
|
|
1637
|
+
});
|
|
1638
|
+
var PageBlockFrame = _zod.z.object({
|
|
1639
|
+
persistentId: _zod.z.string(),
|
|
1640
|
+
sourceId: _zod.z.string(),
|
|
1641
|
+
sourceFrameId: _zod.z.string(),
|
|
1642
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1643
|
+
description: nullishToOptional(_zod.z.string()),
|
|
1644
|
+
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
1645
|
+
origin: nullishToOptional(PageBlockFrameOrigin)
|
|
1646
|
+
});
|
|
1647
|
+
var PageBlockAsset = _zod.z.object({
|
|
1648
|
+
type: PageBlockAssetType,
|
|
1649
|
+
id: nullishToOptional(_zod.z.string()),
|
|
1650
|
+
url: nullishToOptional(_zod.z.string()),
|
|
1651
|
+
figmaFrame: nullishToOptional(PageBlockFrame)
|
|
1652
|
+
});
|
|
1653
|
+
var PageBlockLinkPreview = _zod.z.object({
|
|
1654
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1655
|
+
valid: nullishToOptional(_zod.z.boolean())
|
|
1656
|
+
});
|
|
1657
|
+
var PageBlockShortcut = _zod.z.object({
|
|
1658
|
+
persistentId: _zod.z.string(),
|
|
1659
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1660
|
+
description: nullishToOptional(_zod.z.string()),
|
|
1661
|
+
asset: nullishToOptional(PageBlockAsset),
|
|
1662
|
+
documentationItemId: nullishToOptional(_zod.z.string()),
|
|
1663
|
+
pageHeadingId: nullishToOptional(_zod.z.string()),
|
|
1664
|
+
url: nullishToOptional(_zod.z.string()),
|
|
1665
|
+
openInNewTab: nullishToOptional(_zod.z.boolean()),
|
|
1666
|
+
urlPreview: nullishToOptional(PageBlockUrlPreview),
|
|
1667
|
+
documentationItemPreview: nullishToOptional(PageBlockLinkPreview)
|
|
1668
|
+
});
|
|
1669
|
+
var PageBlockCustomBlockPropertyImageValue = _zod.z.object({
|
|
1670
|
+
asset: nullishToOptional(PageBlockAsset),
|
|
1671
|
+
assetId: nullishToOptional(_zod.z.string()),
|
|
1672
|
+
assetUrl: nullishToOptional(_zod.z.string())
|
|
1673
|
+
});
|
|
1674
|
+
var PageBlockCustomBlockPropertyValue = _zod.z.object({
|
|
1675
|
+
key: _zod.z.string(),
|
|
1676
|
+
value: _zod.z.any()
|
|
1677
|
+
// TODO Artem: for some reason there are cases when there's an array here in the DB
|
|
1678
|
+
// e.g. element id 67451 in the dev db
|
|
1679
|
+
// value: z
|
|
1680
|
+
// .boolean()
|
|
1681
|
+
// .or(z.number())
|
|
1682
|
+
// .or(z.string())
|
|
1683
|
+
// .or(ColorTokenData)
|
|
1684
|
+
// .or(TypographyTokenData)
|
|
1685
|
+
// .or(PageBlockCustomBlockPropertyImageValue),
|
|
1686
|
+
});
|
|
1687
|
+
var PageBlockFigmaFrameProperties = _zod.z.object({
|
|
1688
|
+
color: nullishToOptional(
|
|
1689
|
+
_zod.z.object({
|
|
1690
|
+
value: _zod.z.string()
|
|
1691
|
+
})
|
|
1692
|
+
),
|
|
1693
|
+
alignment: PageBlockTilesAlignment,
|
|
1694
|
+
layout: PageBlockTilesLayout,
|
|
1695
|
+
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
1696
|
+
showTitles: _zod.z.boolean()
|
|
1697
|
+
});
|
|
1698
|
+
var PageBlockRenderCodeProperties = _zod.z.object({
|
|
1699
|
+
showCode: _zod.z.boolean(),
|
|
1700
|
+
showControls: _zod.z.boolean().optional()
|
|
1701
|
+
});
|
|
1702
|
+
var PageBlockAssetComponent = _zod.z.object({
|
|
1703
|
+
persistentId: _zod.z.string(),
|
|
1704
|
+
componentAssetId: _zod.z.string(),
|
|
1705
|
+
title: nullishToOptional(_zod.z.string()),
|
|
1706
|
+
description: nullishToOptional(_zod.z.string()),
|
|
1707
|
+
backgroundColor: nullishToOptional(ColorTokenInlineData)
|
|
1708
|
+
});
|
|
1709
|
+
var PageBlockTableColumn = _zod.z.object({
|
|
1710
|
+
id: _zod.z.string(),
|
|
1711
|
+
width: DimensionTokenData
|
|
1712
|
+
});
|
|
1713
|
+
var PageBlockTableProperties = _zod.z.object({
|
|
1714
|
+
showBorders: _zod.z.boolean(),
|
|
1715
|
+
showHeaderRow: _zod.z.boolean(),
|
|
1716
|
+
showHeaderColumn: _zod.z.boolean(),
|
|
1717
|
+
columns: _zod.z.array(PageBlockTableColumn)
|
|
1718
|
+
});
|
|
1719
|
+
var PageBlockTextSpanAttributeType = _zod.z.enum(["Bold", "Italic", "Link", "Strikethrough", "Code", "Comment"]);
|
|
1720
|
+
var PageBlockTextSpanAttribute = _zod.z.object({
|
|
1721
|
+
type: PageBlockTextSpanAttributeType,
|
|
1722
|
+
// Link attributes
|
|
1723
|
+
link: nullishToOptional(_zod.z.string()),
|
|
1724
|
+
documentationItemId: nullishToOptional(_zod.z.string()),
|
|
1725
|
+
openInNewWindow: nullishToOptional(_zod.z.boolean()),
|
|
1726
|
+
// deprecated. use openInNewTab
|
|
1727
|
+
openInNewTab: nullishToOptional(_zod.z.boolean()),
|
|
1728
|
+
// Comment attributes
|
|
1729
|
+
commentHighlightId: nullishToOptional(_zod.z.string()),
|
|
1730
|
+
commentIsResolved: nullishToOptional(_zod.z.boolean())
|
|
1731
|
+
});
|
|
1732
|
+
var PageBlockTextSpan = _zod.z.object({
|
|
1733
|
+
text: _zod.z.string(),
|
|
1734
|
+
attributes: _zod.z.array(PageBlockTextSpanAttribute)
|
|
1735
|
+
});
|
|
1736
|
+
var PageBlockText = _zod.z.object({
|
|
1737
|
+
spans: _zod.z.array(PageBlockTextSpan)
|
|
1738
|
+
});
|
|
1739
|
+
var PageBlockGuideline = _zod.z.object({
|
|
1740
|
+
description: nullishToOptional(_zod.z.string()),
|
|
1741
|
+
asset: nullishToOptional(PageBlockAsset),
|
|
1742
|
+
type: _zod.z.string()
|
|
1743
|
+
});
|
|
1744
|
+
var PageBlockBaseV1 = _zod.z.object({
|
|
1745
|
+
persistentId: _zod.z.string(),
|
|
1746
|
+
type: PageBlockTypeV1,
|
|
1747
|
+
numberOfColumns: nullishToOptional(_zod.z.number()),
|
|
1748
|
+
// Element linking
|
|
1749
|
+
designObjectId: nullishToOptional(_zod.z.string()),
|
|
1750
|
+
designObjectIds: nullishToOptional(_zod.z.array(_zod.z.string())),
|
|
1751
|
+
tokenType: nullishToOptional(DesignTokenType.or(_zod.z.literal("Font"))),
|
|
1752
|
+
showNestedGroups: nullishToOptional(_zod.z.boolean()),
|
|
1753
|
+
brandId: nullishToOptional(_zod.z.string()),
|
|
1754
|
+
// Rich text
|
|
1755
|
+
text: nullishToOptional(PageBlockText),
|
|
1756
|
+
caption: nullishToOptional(_zod.z.string()),
|
|
1757
|
+
headingType: nullishToOptional(_zod.z.number().min(1).max(3)),
|
|
1758
|
+
codeLanguage: nullishToOptional(PageBlockCodeLanguage),
|
|
1759
|
+
calloutType: nullishToOptional(PageBlockCalloutType),
|
|
1760
|
+
urlInput: nullishToOptional(_zod.z.string()),
|
|
1761
|
+
url: nullishToOptional(_zod.z.string()),
|
|
1762
|
+
urlPreview: nullishToOptional(PageBlockUrlPreview),
|
|
1763
|
+
// Image
|
|
1764
|
+
asset: nullishToOptional(PageBlockAsset),
|
|
1765
|
+
alignment: nullishToOptional(PageBlockAlignment),
|
|
1766
|
+
// Shortcuts block
|
|
1767
|
+
shortcuts: nullishToOptional(_zod.z.array(PageBlockShortcut)),
|
|
1768
|
+
// Guidelines
|
|
1769
|
+
guidelines: nullishToOptional(PageBlockGuideline.array()),
|
|
1770
|
+
// Custom blocks
|
|
1771
|
+
customBlockKey: nullishToOptional(_zod.z.string()),
|
|
1772
|
+
customBlockProperties: nullishToOptional(_zod.z.array(PageBlockCustomBlockPropertyValue)),
|
|
1773
|
+
variantKey: nullishToOptional(_zod.z.string()),
|
|
1774
|
+
// Figma frames
|
|
1775
|
+
figmaFrameProperties: nullishToOptional(PageBlockFigmaFrameProperties),
|
|
1776
|
+
figmaFrames: nullishToOptional(_zod.z.array(PageBlockFrame)),
|
|
1777
|
+
// Generic
|
|
1778
|
+
size: nullishToOptional(Size),
|
|
1779
|
+
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
1780
|
+
// Render code
|
|
1781
|
+
renderCodeProperties: nullishToOptional(PageBlockRenderCodeProperties),
|
|
1782
|
+
// Component assets
|
|
1783
|
+
componentAssets: nullishToOptional(_zod.z.array(PageBlockAssetComponent)),
|
|
1784
|
+
// Tables
|
|
1785
|
+
tableProperties: nullishToOptional(PageBlockTableProperties),
|
|
1786
|
+
columnId: nullishToOptional(_zod.z.string()),
|
|
1787
|
+
// Token spreadsheet
|
|
1788
|
+
theme: nullishToOptional(PageBlockTheme),
|
|
1789
|
+
blacklistedElementProperties: nullishToOptional(_zod.z.array(_zod.z.string())),
|
|
1790
|
+
// Arbitrary
|
|
1791
|
+
userMetadata: nullishToOptional(_zod.z.string())
|
|
1792
|
+
});
|
|
1793
|
+
var PageBlockV1 = PageBlockBaseV1.extend({
|
|
1794
|
+
children: _zod.z.lazy(
|
|
1795
|
+
() => PageBlockV1.array().nullish().transform((t) => _nullishCoalesce(t, () => ( [])))
|
|
1796
|
+
)
|
|
1797
|
+
});
|
|
1798
|
+
function removeCommentSpans(text) {
|
|
1799
|
+
const { spans, ...rest } = text;
|
|
1800
|
+
const newSpans = spans.map((s) => {
|
|
1801
|
+
return {
|
|
1802
|
+
...s,
|
|
1803
|
+
attributes: s.attributes.filter((a) => a.type !== "Comment")
|
|
1804
|
+
};
|
|
1805
|
+
});
|
|
1806
|
+
const updatedRichText = {
|
|
1807
|
+
...rest,
|
|
1808
|
+
spans: newSpans
|
|
1809
|
+
};
|
|
1810
|
+
return joinRepeatingSpans(updatedRichText);
|
|
1811
|
+
}
|
|
1812
|
+
function joinRepeatingSpans(text) {
|
|
1813
|
+
if (text.spans.length < 2)
|
|
1814
|
+
return text;
|
|
1815
|
+
text = sanitizeSpans(text);
|
|
1816
|
+
const { spans, ...rest } = text;
|
|
1817
|
+
let previousSpan = { ...spans[0] };
|
|
1818
|
+
const newSpans = [previousSpan];
|
|
1819
|
+
for (let i = 1; i < spans.length; i++) {
|
|
1820
|
+
const span = spans[i];
|
|
1821
|
+
if (areAttributesEqual(span.attributes, previousSpan.attributes)) {
|
|
1822
|
+
previousSpan.text += span.text;
|
|
1823
|
+
} else {
|
|
1824
|
+
previousSpan = { ...span };
|
|
1825
|
+
newSpans.push(previousSpan);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
return {
|
|
1829
|
+
...rest,
|
|
1830
|
+
spans: newSpans
|
|
1831
|
+
};
|
|
1832
|
+
}
|
|
1833
|
+
function areAttributesEqual(lhs, rhs) {
|
|
1834
|
+
if (lhs.length !== rhs.length)
|
|
1835
|
+
return false;
|
|
1836
|
+
const lhsMap = mapByUnique(lhs, (i) => i.type);
|
|
1837
|
+
for (const rhsAttribute of rhs) {
|
|
1838
|
+
const lhsAttribute = lhsMap.get(rhsAttribute.type);
|
|
1839
|
+
if (!_deepequal2.default.call(void 0, lhsAttribute, rhsAttribute))
|
|
1840
|
+
return false;
|
|
1841
|
+
}
|
|
1842
|
+
return true;
|
|
1843
|
+
}
|
|
1844
|
+
function sanitizeSpans(text) {
|
|
1845
|
+
const { spans, ...rest } = text;
|
|
1846
|
+
return {
|
|
1847
|
+
...rest,
|
|
1848
|
+
spans: spans.map((s) => {
|
|
1849
|
+
const { attributes, ...rest2 } = s;
|
|
1850
|
+
return {
|
|
1851
|
+
...rest2,
|
|
1852
|
+
attributes: attributes.map(sanitizeSpanAttribute)
|
|
1853
|
+
};
|
|
1854
|
+
})
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
function sanitizeSpanAttribute(attribute) {
|
|
1858
|
+
switch (attribute.type) {
|
|
1859
|
+
case "Bold":
|
|
1860
|
+
return { type: "Bold" };
|
|
1861
|
+
case "Code":
|
|
1862
|
+
return { type: "Code" };
|
|
1863
|
+
case "Strikethrough":
|
|
1864
|
+
return { type: "Strikethrough" };
|
|
1865
|
+
case "Italic":
|
|
1866
|
+
return { type: "Italic" };
|
|
1867
|
+
case "Comment":
|
|
1868
|
+
const { commentHighlightId, commentIsResolved } = attribute;
|
|
1869
|
+
const isCommentIsResolvedDefined = commentIsResolved !== void 0 && commentIsResolved !== null;
|
|
1870
|
+
return {
|
|
1871
|
+
type: "Comment",
|
|
1872
|
+
...isCommentIsResolvedDefined && { commentIsResolved },
|
|
1873
|
+
...commentHighlightId && { commentHighlightId }
|
|
1874
|
+
};
|
|
1875
|
+
case "Link":
|
|
1876
|
+
const { documentationItemId, link, openInNewTab, openInNewWindow } = attribute;
|
|
1877
|
+
const isOpenInNewTabDefined = openInNewTab !== void 0 && openInNewTab !== null;
|
|
1878
|
+
const isOpenInNewWindowDefined = openInNewWindow !== void 0 && openInNewWindow !== null;
|
|
1879
|
+
return {
|
|
1880
|
+
type: "Link",
|
|
1881
|
+
...isOpenInNewTabDefined && { openInNewTab },
|
|
1882
|
+
...isOpenInNewWindowDefined && { openInNewWindow },
|
|
1883
|
+
...documentationItemId && { documentationItemId },
|
|
1884
|
+
...link && { link }
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
var PageBlockLinkType = _zod.z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
1889
|
+
var PageBlockImageType = _zod.z.enum(["Resource", "FigmaNode"]);
|
|
1890
|
+
var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
1891
|
+
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
1892
|
+
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
1893
|
+
var PageBlockThemeDisplayMode = _zod.z.enum(["Split", "Override"]);
|
|
1894
|
+
var PageBlockImageResourceReference = _zod.z.object({
|
|
1895
|
+
resourceId: _zod.z.string(),
|
|
1896
|
+
url: _zod.z.string()
|
|
1897
|
+
});
|
|
1898
|
+
var PageBlockResourceFrameNodeReference = _zod.z.object({
|
|
1899
|
+
sourceId: _zod.z.string(),
|
|
1900
|
+
frameReferenceId: _zod.z.string()
|
|
1901
|
+
});
|
|
1902
|
+
var PageBlockImageReference = _zod.z.object({
|
|
1903
|
+
type: PageBlockImageType,
|
|
1904
|
+
resource: PageBlockImageResourceReference.optional(),
|
|
1905
|
+
figmaNode: PageBlockResourceFrameNodeReference.optional()
|
|
1906
|
+
});
|
|
1907
|
+
var PageBlockColorV2 = _zod.z.object({
|
|
1908
|
+
value: _zod.z.string(),
|
|
1909
|
+
referencedTokenId: _zod.z.string().optional()
|
|
1910
|
+
});
|
|
1911
|
+
var PageBlockAssetEntityMeta = _zod.z.object({
|
|
1912
|
+
title: _zod.z.string().optional(),
|
|
1913
|
+
description: _zod.z.string().optional(),
|
|
1914
|
+
backgroundColor: PageBlockColorV2.optional()
|
|
1915
|
+
});
|
|
1916
|
+
var PageBlockFigmaComponentEntityMeta = _zod.z.object({
|
|
1917
|
+
title: _zod.z.string().optional(),
|
|
1918
|
+
description: _zod.z.string().optional(),
|
|
1919
|
+
backgroundColor: PageBlockColorV2.optional(),
|
|
1920
|
+
selectedComponentProperties: _zod.z.array(_zod.z.string()).optional()
|
|
1921
|
+
});
|
|
1922
|
+
var PageBlockFigmaNodeEntityMeta = _zod.z.object({
|
|
1923
|
+
title: _zod.z.string().optional(),
|
|
1924
|
+
description: _zod.z.string().optional(),
|
|
1925
|
+
backgroundColor: PageBlockColorV2.optional()
|
|
1926
|
+
});
|
|
1927
|
+
var PageBlockAppearanceV2 = _zod.z.object({
|
|
1928
|
+
itemBackgroundColor: PageBlockColorV2.optional(),
|
|
1929
|
+
numberOfColumns: _zod.z.number().optional()
|
|
1930
|
+
});
|
|
1931
|
+
var PageBlockItemUntypedValue = _zod.z.object({
|
|
1932
|
+
value: _zod.z.any()
|
|
1933
|
+
}).and(_zod.z.record(_zod.z.any()));
|
|
1934
|
+
var PageBlockLinkV2 = _zod.z.object({
|
|
1935
|
+
type: PageBlockLinkType,
|
|
1936
|
+
documentationItemId: _zod.z.string().optional(),
|
|
1937
|
+
pageHeadingId: _zod.z.string().optional(),
|
|
1938
|
+
url: _zod.z.string().optional(),
|
|
1939
|
+
openInNewTab: _zod.z.boolean().optional()
|
|
1940
|
+
});
|
|
1941
|
+
var PageBlockItemV2 = _zod.z.object({
|
|
1942
|
+
id: _zod.z.string(),
|
|
1943
|
+
linksTo: PageBlockLinkV2.optional(),
|
|
1944
|
+
props: _zod.z.record(PageBlockItemUntypedValue)
|
|
1945
|
+
});
|
|
1946
|
+
var PageBlockDataV2 = _zod.z.object({
|
|
1947
|
+
packageId: _zod.z.string(),
|
|
1948
|
+
variantId: _zod.z.string().optional(),
|
|
1949
|
+
indentLevel: _zod.z.number(),
|
|
1950
|
+
appearance: PageBlockAppearanceV2.optional(),
|
|
1951
|
+
items: _zod.z.array(PageBlockItemV2)
|
|
1952
|
+
});
|
|
1953
|
+
var PageBlockItemAssetValue = _zod.z.object({
|
|
1954
|
+
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
1955
|
+
showSearch: _zod.z.boolean().optional(),
|
|
1956
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
1957
|
+
backgroundColor: PageBlockColorV2.optional(),
|
|
1958
|
+
value: _zod.z.array(
|
|
1959
|
+
_zod.z.object({
|
|
1960
|
+
entityId: _zod.z.string(),
|
|
1961
|
+
entityType: _zod.z.enum(["Asset", "AssetGroup"]),
|
|
1962
|
+
entityMeta: PageBlockAssetEntityMeta.optional()
|
|
1963
|
+
})
|
|
1964
|
+
).default([])
|
|
1965
|
+
});
|
|
1966
|
+
var PageBlockItemAssetPropertyValue = _zod.z.object({
|
|
1967
|
+
value: _zod.z.array(_zod.z.string()).default([])
|
|
1968
|
+
});
|
|
1969
|
+
var PageBlockItemFigmaComponentValue = _zod.z.object({
|
|
1970
|
+
showComponentName: _zod.z.boolean().optional(),
|
|
1971
|
+
showComponentDescription: _zod.z.boolean().optional(),
|
|
1972
|
+
showPropertyList: _zod.z.boolean().optional(),
|
|
1973
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
1974
|
+
backgroundColor: PageBlockColorV2.optional(),
|
|
1975
|
+
value: _zod.z.array(
|
|
1976
|
+
_zod.z.object({
|
|
1977
|
+
entityId: _zod.z.string(),
|
|
1978
|
+
entityType: _zod.z.enum(["FigmaComponent"]),
|
|
1979
|
+
entityMeta: PageBlockFigmaComponentEntityMeta.optional()
|
|
1980
|
+
})
|
|
1981
|
+
).default([])
|
|
1982
|
+
});
|
|
1983
|
+
var PageBlockItemBooleanValue = _zod.z.object({
|
|
1984
|
+
value: _zod.z.boolean()
|
|
1985
|
+
});
|
|
1986
|
+
var PageBlockItemCodeValue = _zod.z.object({
|
|
1987
|
+
format: PageBlockCodeLanguage.optional(),
|
|
1988
|
+
caption: _zod.z.string().optional(),
|
|
1989
|
+
value: _zod.z.string()
|
|
1990
|
+
});
|
|
1991
|
+
var PageBlockItemSandboxValue = _zod.z.object({
|
|
1992
|
+
showCode: _zod.z.boolean().optional(),
|
|
1993
|
+
showControls: _zod.z.boolean().optional(),
|
|
1994
|
+
backgroundColor: _zod.z.string().optional(),
|
|
1995
|
+
alignPreview: _zod.z.enum(["Left", "Center"]).optional(),
|
|
1996
|
+
previewHeight: _zod.z.number().optional(),
|
|
1997
|
+
value: _zod.z.string()
|
|
1998
|
+
});
|
|
1999
|
+
var PageBlockItemColorValue = _zod.z.record(_zod.z.any());
|
|
2000
|
+
var PageBlockItemComponentValue = _zod.z.object({
|
|
2001
|
+
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
2002
|
+
value: _zod.z.array(
|
|
2003
|
+
_zod.z.object({
|
|
2004
|
+
entityId: _zod.z.string(),
|
|
2005
|
+
entityType: _zod.z.enum(["Component", "ComponentGroup"])
|
|
2006
|
+
})
|
|
2007
|
+
).default([])
|
|
2008
|
+
});
|
|
2009
|
+
var PageBlockItemComponentPropertyValue = _zod.z.object({
|
|
2010
|
+
value: _zod.z.string()
|
|
2011
|
+
});
|
|
2012
|
+
var PageBlockItemDividerValue = _zod.z.object({});
|
|
2013
|
+
var PageBlockItemEmbedValue = _zod.z.object({
|
|
2014
|
+
value: _zod.z.string().optional(),
|
|
2015
|
+
caption: _zod.z.string().optional(),
|
|
2016
|
+
height: _zod.z.number().optional(),
|
|
2017
|
+
openGraph: _zod.z.object({
|
|
2018
|
+
title: _zod.z.string().optional(),
|
|
2019
|
+
description: _zod.z.string().optional(),
|
|
2020
|
+
imageUrl: _zod.z.string().optional()
|
|
2021
|
+
}).optional()
|
|
2022
|
+
});
|
|
2023
|
+
var PageBlockItemFigmaNodeValue = _zod.z.object({
|
|
2024
|
+
showSearch: _zod.z.boolean().optional(),
|
|
2025
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
2026
|
+
backgroundColor: PageBlockColorV2.optional(),
|
|
2027
|
+
showFrameDetails: _zod.z.boolean().optional(),
|
|
2028
|
+
value: _zod.z.array(
|
|
2029
|
+
_zod.z.object({
|
|
2030
|
+
entityId: _zod.z.string(),
|
|
2031
|
+
entityMeta: PageBlockFigmaNodeEntityMeta.optional()
|
|
2032
|
+
})
|
|
2033
|
+
).default([])
|
|
2034
|
+
});
|
|
2035
|
+
var PageBlockItemImageValue = _zod.z.object({
|
|
2036
|
+
alt: _zod.z.string().optional(),
|
|
2037
|
+
caption: _zod.z.string().optional(),
|
|
2038
|
+
alignment: PageBlockImageAlignment.optional(),
|
|
2039
|
+
value: PageBlockImageReference.optional()
|
|
2040
|
+
});
|
|
2041
|
+
var PageBlockItemMarkdownValue = _zod.z.object({
|
|
2042
|
+
value: _zod.z.string()
|
|
2043
|
+
});
|
|
2044
|
+
var PageBlockItemMultiRichTextValue = _zod.z.object({
|
|
2045
|
+
value: PageBlockText.array()
|
|
2046
|
+
});
|
|
2047
|
+
var PageBlockItemMultiSelectValue = _zod.z.object({
|
|
2048
|
+
value: _zod.z.array(_zod.z.string()).default([])
|
|
2049
|
+
});
|
|
2050
|
+
var PageBlockItemNumberValue = _zod.z.object({
|
|
2051
|
+
value: _zod.z.number()
|
|
2052
|
+
});
|
|
2053
|
+
var PageBlockItemRichTextValue = _zod.z.object({
|
|
2054
|
+
value: PageBlockText,
|
|
2055
|
+
calloutType: PageBlockCalloutType.optional()
|
|
2056
|
+
});
|
|
2057
|
+
var PageBlockItemSingleSelectValue = _zod.z.object({
|
|
2058
|
+
value: _zod.z.string()
|
|
2059
|
+
});
|
|
2060
|
+
var PageBlockItemStorybookValue = _zod.z.object({
|
|
2061
|
+
caption: _zod.z.string().optional(),
|
|
2062
|
+
height: _zod.z.number().optional(),
|
|
2063
|
+
embedUrl: _zod.z.string().optional(),
|
|
2064
|
+
value: _zod.z.string().optional()
|
|
2065
|
+
});
|
|
2066
|
+
var PageBlockItemTextValue = _zod.z.object({
|
|
2067
|
+
value: _zod.z.string()
|
|
2068
|
+
});
|
|
2069
|
+
var PageBlockItemTokenValue = _zod.z.object({
|
|
2070
|
+
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
2071
|
+
selectedThemeIds: _zod.z.array(_zod.z.string()).optional(),
|
|
2072
|
+
themeDisplayMode: PageBlockThemeDisplayMode.optional(),
|
|
2073
|
+
value: _zod.z.array(
|
|
2074
|
+
_zod.z.object({
|
|
2075
|
+
entityId: _zod.z.string(),
|
|
2076
|
+
entityType: _zod.z.enum(["Token", "TokenGroup"]),
|
|
2077
|
+
entityMeta: _zod.z.object({
|
|
2078
|
+
showNestedGroups: _zod.z.boolean().optional()
|
|
2079
|
+
}).optional()
|
|
2080
|
+
})
|
|
2081
|
+
).default([])
|
|
2082
|
+
});
|
|
2083
|
+
var PageBlockItemTokenPropertyValue = _zod.z.object({
|
|
2084
|
+
selectedPropertyIds: _zod.z.array(_zod.z.string()).optional(),
|
|
2085
|
+
selectedThemeIds: _zod.z.array(_zod.z.string()).optional(),
|
|
2086
|
+
value: _zod.z.array(_zod.z.string()).default([])
|
|
2087
|
+
});
|
|
2088
|
+
var PageBlockItemTokenTypeValue = _zod.z.object({
|
|
2089
|
+
value: _zod.z.array(DesignTokenType).default([])
|
|
2090
|
+
});
|
|
2091
|
+
var PageBlockItemUrlValue = _zod.z.object({
|
|
2092
|
+
value: _zod.z.string()
|
|
2093
|
+
});
|
|
2094
|
+
var PageBlockItemTableRichTextNode = _zod.z.object({
|
|
2095
|
+
type: _zod.z.literal("RichText"),
|
|
2096
|
+
id: _zod.z.string(),
|
|
2097
|
+
value: PageBlockItemRichTextValue.shape.value
|
|
2098
|
+
});
|
|
2099
|
+
var PageBlockItemTableMultiRichTextNode = _zod.z.object({
|
|
2100
|
+
type: _zod.z.literal("MultiRichText"),
|
|
2101
|
+
value: PageBlockItemMultiRichTextValue.shape.value
|
|
2102
|
+
});
|
|
2103
|
+
var PageBlockItemTableImageNode = _zod.z.object({
|
|
2104
|
+
type: _zod.z.literal("Image"),
|
|
2105
|
+
id: _zod.z.string(),
|
|
2106
|
+
caption: PageBlockItemImageValue.shape.caption,
|
|
2107
|
+
value: PageBlockItemImageValue.shape.value
|
|
2108
|
+
});
|
|
2109
|
+
var PageBlockItemTableNode = _zod.z.discriminatedUnion("type", [
|
|
2110
|
+
PageBlockItemTableRichTextNode,
|
|
2111
|
+
// PageBlockItemTableMultiRichTextNode,
|
|
2112
|
+
PageBlockItemTableImageNode
|
|
2113
|
+
]);
|
|
2114
|
+
var PageBlockItemTableCell = _zod.z.object({
|
|
2115
|
+
id: _zod.z.string(),
|
|
2116
|
+
nodes: _zod.z.array(PageBlockItemTableNode),
|
|
2117
|
+
columnWidth: _zod.z.number().optional(),
|
|
2118
|
+
alignment: PageBlockTableCellAlignment
|
|
2119
|
+
});
|
|
2120
|
+
var PageBlockItemTableRow = _zod.z.object({
|
|
2121
|
+
cells: _zod.z.array(PageBlockItemTableCell)
|
|
2122
|
+
});
|
|
2123
|
+
var PageBlockItemTableValue = _zod.z.object({
|
|
2124
|
+
highlightHeaderColumn: _zod.z.boolean().optional(),
|
|
2125
|
+
highlightHeaderRow: _zod.z.boolean().optional(),
|
|
2126
|
+
showBorder: _zod.z.boolean().optional(),
|
|
2127
|
+
value: _zod.z.array(PageBlockItemTableRow).default([])
|
|
2128
|
+
});
|
|
2129
|
+
var DocumentationItemHeaderAlignmentSchema = _zod.z.enum(["Left", "Center"]);
|
|
2130
|
+
var DocumentationItemHeaderImageScaleTypeSchema = _zod.z.enum(["AspectFill", "AspectFit"]);
|
|
2131
|
+
var DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;
|
|
2132
|
+
var DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTypeSchema.enum;
|
|
2133
|
+
var DocumentationItemHeaderV1 = _zod.z.object({
|
|
2134
|
+
description: _zod.z.string(),
|
|
2135
|
+
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
2136
|
+
foregroundColor: ColorTokenData.nullish(),
|
|
2137
|
+
backgroundColor: ColorTokenData.nullish(),
|
|
2138
|
+
backgroundImageAsset: PageBlockAsset.nullish(),
|
|
2139
|
+
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
2140
|
+
showBackgroundOverlay: _zod.z.boolean(),
|
|
2141
|
+
showCoverText: _zod.z.boolean(),
|
|
2142
|
+
minHeight: _zod.z.number().nullish()
|
|
2143
|
+
});
|
|
2144
|
+
var defaultDocumentationItemHeaderV1 = {
|
|
2145
|
+
alignment: DocumentationItemHeaderAlignment.Left,
|
|
2146
|
+
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
2147
|
+
description: "",
|
|
2148
|
+
showBackgroundOverlay: false,
|
|
2149
|
+
showCoverText: true
|
|
2150
|
+
};
|
|
2151
|
+
var DocumentationItemConfigurationV1 = _zod.z.object({
|
|
2152
|
+
showSidebar: _zod.z.boolean(),
|
|
2153
|
+
isPrivate: _zod.z.boolean().optional(),
|
|
2154
|
+
isHidden: _zod.z.boolean().optional(),
|
|
2155
|
+
header: DocumentationItemHeaderV1
|
|
2156
|
+
});
|
|
2157
|
+
var DocumentationPageDataV1 = _zod.z.object({
|
|
2158
|
+
blocks: _zod.z.array(PageBlockV1),
|
|
2159
|
+
configuration: nullishToOptional(DocumentationItemConfigurationV1)
|
|
2160
|
+
});
|
|
2161
|
+
var DocumentationItemHeaderV2 = _zod.z.object({
|
|
2162
|
+
description: _zod.z.string(),
|
|
2163
|
+
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
2164
|
+
foregroundColor: PageBlockColorV2.nullish(),
|
|
2165
|
+
backgroundColor: PageBlockColorV2.nullish(),
|
|
2166
|
+
backgroundImageAsset: PageBlockImageReference.nullish(),
|
|
2167
|
+
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
2168
|
+
showBackgroundOverlay: _zod.z.boolean(),
|
|
2169
|
+
showCoverText: _zod.z.boolean(),
|
|
2170
|
+
minHeight: _zod.z.number().nullish()
|
|
2171
|
+
});
|
|
2172
|
+
var defaultDocumentationItemHeaderV2 = {
|
|
2173
|
+
alignment: DocumentationItemHeaderAlignment.Left,
|
|
2174
|
+
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
2175
|
+
description: "",
|
|
2176
|
+
showBackgroundOverlay: false,
|
|
2177
|
+
showCoverText: true
|
|
2178
|
+
};
|
|
2179
|
+
var DocumentationItemConfigurationV2 = _zod.z.object({
|
|
2180
|
+
showSidebar: _zod.z.boolean(),
|
|
2181
|
+
isPrivate: _zod.z.boolean().optional(),
|
|
2182
|
+
isHidden: _zod.z.boolean().optional(),
|
|
2183
|
+
header: DocumentationItemHeaderV2
|
|
2184
|
+
});
|
|
2185
|
+
var defaultDocumentationItemConfigurationV2 = {
|
|
2186
|
+
header: defaultDocumentationItemHeaderV2,
|
|
2187
|
+
isHidden: false,
|
|
2188
|
+
isPrivate: false,
|
|
2189
|
+
showSidebar: true
|
|
2190
|
+
};
|
|
2191
|
+
var DocumentationPageDataV2 = _zod.z.object({
|
|
2192
|
+
configuration: nullishToOptional(DocumentationItemConfigurationV2)
|
|
2193
|
+
});
|
|
2194
|
+
var DesignElementOrigin = _zod.z.object({
|
|
2195
|
+
id: _zod.z.string(),
|
|
2196
|
+
sourceId: _zod.z.string(),
|
|
2197
|
+
name: _zod.z.string()
|
|
2198
|
+
});
|
|
2199
|
+
var DesignElementBase = _zod.z.object({
|
|
2200
|
+
id: _zod.z.string(),
|
|
2201
|
+
persistentId: _zod.z.string(),
|
|
2202
|
+
meta: ObjectMeta,
|
|
2203
|
+
designSystemVersionId: _zod.z.string(),
|
|
2204
|
+
createdAt: _zod.z.coerce.date(),
|
|
2205
|
+
updatedAt: _zod.z.coerce.date()
|
|
2206
|
+
});
|
|
2207
|
+
var DesignElementImportedBase = DesignElementBase.extend({
|
|
2208
|
+
origin: DesignElementOrigin
|
|
2209
|
+
});
|
|
2210
|
+
var DesignElementGroupablePart = _zod.z.object({
|
|
2211
|
+
parentPersistentId: _zod.z.string().optional(),
|
|
2212
|
+
sortOrder: _zod.z.number()
|
|
2213
|
+
});
|
|
2214
|
+
var DesignElementGroupableBase = DesignElementBase.extend(DesignElementGroupablePart.shape);
|
|
2215
|
+
var DesignElementGroupableRequiredPart = DesignElementGroupablePart.extend({
|
|
2216
|
+
parentPersistentId: _zod.z.string()
|
|
2217
|
+
});
|
|
2218
|
+
var DesignElementBrandedPart = _zod.z.object({
|
|
2219
|
+
brandPersistentId: _zod.z.string()
|
|
2220
|
+
});
|
|
2221
|
+
var DesignElementSlugPart = _zod.z.object({
|
|
2222
|
+
slug: _zod.z.string().optional(),
|
|
2223
|
+
userSlug: _zod.z.string().optional()
|
|
2224
|
+
});
|
|
2225
|
+
var PageBlockV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend({
|
|
2226
|
+
data: PageBlockDataV2
|
|
2227
|
+
});
|
|
2228
|
+
var PageBlockEditorModelV2 = _zod.z.object({
|
|
2229
|
+
id: _zod.z.string(),
|
|
2230
|
+
type: _zod.z.literal("Block"),
|
|
2231
|
+
data: PageBlockDataV2
|
|
2232
|
+
});
|
|
2233
|
+
var PageSectionTypeV2 = _zod.z.enum(["Tabs"]);
|
|
2234
|
+
var PageSectionColumnV2 = _zod.z.object({
|
|
2235
|
+
id: _zod.z.string(),
|
|
2236
|
+
blocks: _zod.z.array(PageBlockEditorModelV2)
|
|
2237
|
+
});
|
|
2238
|
+
var PageSectionItemV2 = _zod.z.object({
|
|
2239
|
+
id: _zod.z.string(),
|
|
2240
|
+
title: _zod.z.string(),
|
|
2241
|
+
columns: _zod.z.array(PageSectionColumnV2)
|
|
2242
|
+
});
|
|
2243
|
+
var PageSectionPaddingV2 = _zod.z.object({
|
|
2244
|
+
top: _zod.z.number().optional(),
|
|
2245
|
+
bottom: _zod.z.number().optional(),
|
|
2246
|
+
left: _zod.z.number().optional(),
|
|
2247
|
+
right: _zod.z.number().optional()
|
|
2248
|
+
});
|
|
2249
|
+
var PageSectionAppearanceV2 = _zod.z.object({
|
|
2250
|
+
expandToEdges: _zod.z.boolean(),
|
|
2251
|
+
contentExpandToEdges: _zod.z.boolean(),
|
|
2252
|
+
backgroundColor: PageBlockColorV2.optional(),
|
|
2253
|
+
foregroundColor: PageBlockColorV2.optional(),
|
|
2254
|
+
padding: PageSectionPaddingV2.optional()
|
|
2255
|
+
});
|
|
2256
|
+
var PageSectionEditorModelV2 = _zod.z.object({
|
|
2257
|
+
id: _zod.z.string(),
|
|
2258
|
+
type: _zod.z.literal("Section"),
|
|
2259
|
+
variantId: _zod.z.string().optional(),
|
|
2260
|
+
sectionType: PageSectionTypeV2,
|
|
2261
|
+
appearance: PageSectionAppearanceV2,
|
|
2262
|
+
items: _zod.z.array(PageSectionItemV2)
|
|
2263
|
+
});
|
|
2264
|
+
var DurationUnit = _zod.z.enum(["Ms"]);
|
|
2265
|
+
var DurationValue = _zod.z.object({
|
|
2266
|
+
unit: DurationUnit,
|
|
2267
|
+
measure: _zod.z.number()
|
|
2268
|
+
});
|
|
2269
|
+
var DurationTokenData = tokenAliasOrValue(DurationValue);
|
|
2270
|
+
var FigmaFileStructureNodeType = _zod.z.enum(["DOCUMENT", "CANVAS", "FRAME", "COMPONENT", "COMPONENT_SET"]);
|
|
2271
|
+
var FigmaFileStructureNodeBase = _zod.z.object({
|
|
2272
|
+
id: _zod.z.string(),
|
|
2273
|
+
name: _zod.z.string(),
|
|
2274
|
+
type: FigmaFileStructureNodeType,
|
|
2275
|
+
size: SizeOrUndefined,
|
|
2276
|
+
parentComponentSetId: _zod.z.string().optional()
|
|
2277
|
+
});
|
|
2278
|
+
var FigmaFileStructureNode = FigmaFileStructureNodeBase.extend({
|
|
2279
|
+
children: _zod.z.lazy(() => FigmaFileStructureNode.array())
|
|
2280
|
+
});
|
|
2281
|
+
var FigmaFileStructureStatistics = _zod.z.object({
|
|
2282
|
+
frames: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0))),
|
|
2283
|
+
components: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0))),
|
|
2284
|
+
componentSets: _zod.z.number().nullable().optional().transform((v) => _nullishCoalesce(v, () => ( 0)))
|
|
2285
|
+
});
|
|
2286
|
+
var FigmaFileStructureElementData = _zod.z.object({
|
|
2287
|
+
value: _zod.z.object({
|
|
2288
|
+
structure: FigmaFileStructureNode,
|
|
2289
|
+
assetsInFile: FigmaFileStructureStatistics
|
|
2290
|
+
})
|
|
2291
|
+
});
|
|
2292
|
+
var FigmaNodeReferenceData = _zod.z.object({
|
|
2293
|
+
structureElementId: _zod.z.string(),
|
|
2294
|
+
nodeId: _zod.z.string(),
|
|
2295
|
+
fileId: _zod.z.string().optional(),
|
|
2296
|
+
valid: _zod.z.boolean(),
|
|
2297
|
+
// Asset data
|
|
2298
|
+
assetId: _zod.z.string().optional(),
|
|
2299
|
+
assetScale: _zod.z.number().optional(),
|
|
2300
|
+
assetWidth: _zod.z.number().optional(),
|
|
2301
|
+
assetHeight: _zod.z.number().optional(),
|
|
2302
|
+
assetUrl: _zod.z.string().optional(),
|
|
2303
|
+
assetOriginKey: _zod.z.string().optional()
|
|
2304
|
+
});
|
|
2305
|
+
var FigmaNodeReferenceElementData = _zod.z.object({
|
|
2306
|
+
value: FigmaNodeReferenceData
|
|
2307
|
+
});
|
|
2308
|
+
var FontFamilyValue = _zod.z.string();
|
|
2309
|
+
var FontFamilyTokenData = tokenAliasOrValue(FontFamilyValue);
|
|
2310
|
+
var FontSizeUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2311
|
+
var FontSizeValue = _zod.z.object({
|
|
2312
|
+
unit: FontSizeUnit,
|
|
2313
|
+
measure: _zod.z.number()
|
|
2314
|
+
});
|
|
2315
|
+
var FontSizeTokenData = tokenAliasOrValue(FontSizeValue);
|
|
2316
|
+
var FontWeightValue = _zod.z.string();
|
|
2317
|
+
var FontWeightTokenData = tokenAliasOrValue(FontWeightValue);
|
|
2318
|
+
var GradientType = _zod.z.enum(["Linear", "Radial", "Angular"]);
|
|
2319
|
+
var GradientStop = _zod.z.object({
|
|
2320
|
+
position: _zod.z.number(),
|
|
2321
|
+
color: ColorTokenData
|
|
2322
|
+
});
|
|
2323
|
+
var GradientLayerValue = _zod.z.object({
|
|
2324
|
+
from: Point2D,
|
|
2325
|
+
to: Point2D,
|
|
2326
|
+
type: GradientType,
|
|
2327
|
+
aspectRatio: nullishToOptional(_zod.z.number()),
|
|
2328
|
+
// z.number(),
|
|
2329
|
+
stops: _zod.z.array(GradientStop).min(2)
|
|
2330
|
+
});
|
|
2331
|
+
var GradientLayerData = tokenAliasOrValue(GradientLayerValue);
|
|
2332
|
+
var GradientTokenValue = _zod.z.array(GradientLayerData);
|
|
2333
|
+
var GradientTokenData = tokenAliasOrValue(GradientTokenValue);
|
|
2334
|
+
var DocumentationGroupBehavior = _zod.z.enum(["Group", "Tabs"]);
|
|
2335
|
+
var ElementGroupDataV1 = _zod.z.object({
|
|
2336
|
+
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
2337
|
+
configuration: nullishToOptional(DocumentationItemConfigurationV1)
|
|
2338
|
+
});
|
|
2339
|
+
var ElementGroupDataV2 = _zod.z.object({
|
|
2340
|
+
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
2341
|
+
configuration: nullishToOptional(DocumentationItemConfigurationV2)
|
|
2342
|
+
});
|
|
2343
|
+
var LetterSpacingUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2344
|
+
var LetterSpacingValue = _zod.z.object({
|
|
2345
|
+
unit: LetterSpacingUnit,
|
|
2346
|
+
measure: _zod.z.number()
|
|
2347
|
+
});
|
|
2348
|
+
var LetterSpacingTokenData = tokenAliasOrValue(LetterSpacingValue);
|
|
2349
|
+
var LineHeightUnit = _zod.z.enum(["Pixels", "Rem", "Percent", "Raw"]);
|
|
2350
|
+
var LineHeightValue = _zod.z.object({
|
|
2351
|
+
unit: LineHeightUnit,
|
|
2352
|
+
measure: _zod.z.number()
|
|
2353
|
+
});
|
|
2354
|
+
var LineHeightTokenData = tokenAliasOrValue(LineHeightValue);
|
|
2355
|
+
var ParagraphIndentUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2356
|
+
var ParagraphIndentValue = _zod.z.object({
|
|
2357
|
+
unit: ParagraphIndentUnit,
|
|
2358
|
+
measure: _zod.z.number()
|
|
2359
|
+
});
|
|
2360
|
+
var ParagraphIndentTokenData = tokenAliasOrValue(ParagraphIndentValue);
|
|
2361
|
+
var ParagraphSpacingUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2362
|
+
var ParagraphSpacingValue = _zod.z.object({
|
|
2363
|
+
unit: ParagraphSpacingUnit,
|
|
2364
|
+
measure: _zod.z.number()
|
|
2365
|
+
});
|
|
2366
|
+
var ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);
|
|
2367
|
+
var ProductCopyValue = _zod.z.string();
|
|
2368
|
+
var ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);
|
|
2369
|
+
var RESERVED_OBJECT_ID_PREFIX = "x-sn-reserved-";
|
|
2370
|
+
var SafeIdSchema = _zod.z.string().refine(
|
|
2371
|
+
(value) => {
|
|
2372
|
+
return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);
|
|
2373
|
+
},
|
|
2374
|
+
{
|
|
2375
|
+
message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`
|
|
2376
|
+
}
|
|
2377
|
+
);
|
|
2378
|
+
var ShadowType = _zod.z.enum(["Drop", "Inner"]);
|
|
2379
|
+
var ShadowLayerValue = _zod.z.object({
|
|
2380
|
+
color: ColorTokenData,
|
|
2381
|
+
x: _zod.z.number(),
|
|
2382
|
+
y: _zod.z.number(),
|
|
2383
|
+
radius: _zod.z.number(),
|
|
2384
|
+
spread: _zod.z.number(),
|
|
2385
|
+
opacity: OpacityTokenData.optional(),
|
|
2386
|
+
type: ShadowType
|
|
2387
|
+
});
|
|
2388
|
+
var ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);
|
|
2389
|
+
var ShadowTokenData = tokenAliasOrValue(_zod.z.array(ShadowTokenDataBase));
|
|
2390
|
+
var SizeUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2391
|
+
var SizeValue = _zod.z.object({
|
|
2392
|
+
unit: SizeUnit,
|
|
2393
|
+
measure: _zod.z.number()
|
|
2394
|
+
});
|
|
2395
|
+
var SizeTokenData = tokenAliasOrValue(SizeValue);
|
|
2396
|
+
var SpaceUnit = _zod.z.enum(["Pixels", "Rem", "Percent"]);
|
|
2397
|
+
var SpaceValue = _zod.z.object({
|
|
2398
|
+
unit: SpaceUnit,
|
|
2399
|
+
measure: _zod.z.number()
|
|
2400
|
+
});
|
|
2401
|
+
var SpaceTokenData = tokenAliasOrValue(SpaceValue);
|
|
2402
|
+
var StringValue = _zod.z.string();
|
|
2403
|
+
var StringTokenData = tokenAliasOrValue(StringValue);
|
|
2404
|
+
var TextCase = _zod.z.enum(["Original", "Upper", "Lower", "Camel", "SmallCaps"]);
|
|
2405
|
+
var TextCaseValue = TextCase;
|
|
2406
|
+
var TextCaseTokenData = tokenAliasOrValue(TextCaseValue);
|
|
2407
|
+
var TextDecoration = _zod.z.enum(["None", "Underline", "Strikethrough"]);
|
|
2408
|
+
var TextDecorationValue = TextDecoration;
|
|
2409
|
+
var TextDecorationTokenData = tokenAliasOrValue(TextDecorationValue);
|
|
2410
|
+
var TypographyValue = _zod.z.object({
|
|
2411
|
+
fontSize: FontSizeTokenData,
|
|
2412
|
+
fontFamily: FontFamilyTokenData,
|
|
2413
|
+
fontWeight: FontWeightTokenData,
|
|
2414
|
+
textDecoration: TextDecorationTokenData,
|
|
2415
|
+
textCase: TextCaseTokenData,
|
|
2416
|
+
letterSpacing: LetterSpacingTokenData.optional(),
|
|
2417
|
+
lineHeight: LineHeightTokenData.optional(),
|
|
2418
|
+
paragraphIndent: ParagraphIndentTokenData.optional(),
|
|
2419
|
+
paragraphSpacing: ParagraphSpacingTokenData.optional()
|
|
2420
|
+
});
|
|
2421
|
+
var TypographyTokenData = tokenAliasOrValue(TypographyValue);
|
|
2422
|
+
var Visibility = _zod.z.enum(["Hidden", "Visible"]);
|
|
2423
|
+
var VisibilityValue = Visibility;
|
|
2424
|
+
var VisibilityTokenData = tokenAliasOrValue(VisibilityValue);
|
|
2425
|
+
var ZIndexUnit = _zod.z.enum(["Raw"]);
|
|
2426
|
+
var ZIndexValue = _zod.z.object({
|
|
2427
|
+
unit: ZIndexUnit,
|
|
2428
|
+
measure: _zod.z.number()
|
|
2429
|
+
});
|
|
2430
|
+
var ZIndexTokenData = tokenAliasOrValue(ZIndexValue);
|
|
2431
|
+
var FigmaComponentPropertyType = _zod.z.enum(["Boolean", "InstanceSwap", "Variant", "Text"]);
|
|
2432
|
+
var FigmaComponentBooleanProperty = _zod.z.object({
|
|
2433
|
+
type: _zod.z.literal(FigmaComponentPropertyType.enum.Boolean),
|
|
2434
|
+
value: _zod.z.boolean(),
|
|
2435
|
+
defaultValue: _zod.z.boolean()
|
|
2436
|
+
});
|
|
2437
|
+
var FigmaComponentInstanceSwapProperty = _zod.z.object({
|
|
2438
|
+
type: _zod.z.literal(FigmaComponentPropertyType.enum.InstanceSwap),
|
|
2439
|
+
value: _zod.z.string()
|
|
2440
|
+
// Persistent ID of a Component to swap?
|
|
2441
|
+
});
|
|
2442
|
+
var FigmaComponentVariantProperty = _zod.z.object({
|
|
2443
|
+
type: _zod.z.literal(FigmaComponentPropertyType.enum.Variant),
|
|
2444
|
+
value: _zod.z.string(),
|
|
2445
|
+
options: _zod.z.array(_zod.z.string())
|
|
2446
|
+
});
|
|
2447
|
+
var FigmaComponentTextProperty = _zod.z.object({
|
|
2448
|
+
type: _zod.z.literal(FigmaComponentPropertyType.enum.Text),
|
|
2449
|
+
value: _zod.z.string()
|
|
2450
|
+
});
|
|
2451
|
+
var FigmaComponentProperties = _zod.z.record(
|
|
2452
|
+
_zod.z.string(),
|
|
2453
|
+
_zod.z.discriminatedUnion("type", [
|
|
2454
|
+
FigmaComponentBooleanProperty,
|
|
2455
|
+
FigmaComponentInstanceSwapProperty,
|
|
2456
|
+
FigmaComponentTextProperty
|
|
2457
|
+
])
|
|
2458
|
+
);
|
|
2459
|
+
var FigmaComponentSetProperties = _zod.z.record(
|
|
2460
|
+
_zod.z.string(),
|
|
2461
|
+
_zod.z.discriminatedUnion("type", [
|
|
2462
|
+
FigmaComponentBooleanProperty,
|
|
2463
|
+
FigmaComponentInstanceSwapProperty,
|
|
2464
|
+
FigmaComponentTextProperty,
|
|
2465
|
+
FigmaComponentVariantProperty
|
|
2466
|
+
])
|
|
2467
|
+
);
|
|
2468
|
+
var ComponentOriginPart = _zod.z.object({
|
|
2469
|
+
nodeId: _zod.z.string().optional(),
|
|
2470
|
+
width: _zod.z.number().optional(),
|
|
2471
|
+
height: _zod.z.number().optional()
|
|
2472
|
+
});
|
|
2473
|
+
var ComponentAsset = _zod.z.object({
|
|
2474
|
+
assetId: _zod.z.string(),
|
|
2475
|
+
assetPath: _zod.z.string()
|
|
2476
|
+
});
|
|
2477
|
+
var ComponentOrigin = DesignElementOrigin.extend(ComponentOriginPart.shape);
|
|
2478
|
+
var BaseComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementBrandedPart.shape).extend({
|
|
2479
|
+
origin: ComponentOrigin.optional(),
|
|
2480
|
+
thumbnail: ComponentAsset
|
|
2481
|
+
});
|
|
2482
|
+
var Component = BaseComponent.extend({
|
|
2483
|
+
svg: ComponentAsset.optional(),
|
|
2484
|
+
isAsset: _zod.z.boolean(),
|
|
2485
|
+
componentSetId: _zod.z.string().optional(),
|
|
2486
|
+
properties: FigmaComponentProperties.optional()
|
|
2487
|
+
});
|
|
2488
|
+
var ComponentSet = BaseComponent.extend({
|
|
2489
|
+
properties: FigmaComponentSetProperties
|
|
2490
|
+
});
|
|
2491
|
+
var ElementGroup = DesignElementBase.extend(DesignElementGroupablePart.shape).extend(DesignElementSlugPart.shape).extend(DesignElementBrandedPart.partial().shape).extend({
|
|
2492
|
+
shortPersistentId: _zod.z.string().optional(),
|
|
2493
|
+
childType: DesignElementType,
|
|
2494
|
+
data: ElementGroupDataV2.optional()
|
|
2495
|
+
});
|
|
2496
|
+
var BrandedElementGroup = ElementGroup.extend(DesignElementBrandedPart.shape);
|
|
2497
|
+
var DocumentationPageV1 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementSlugPart.shape).extend({
|
|
2498
|
+
shortPersistentId: _zod.z.string(),
|
|
2499
|
+
data: DocumentationPageDataV1
|
|
2500
|
+
});
|
|
2501
|
+
var DocumentationGroupV1 = ElementGroup.omit({
|
|
2502
|
+
data: true
|
|
2503
|
+
}).extend({
|
|
2504
|
+
data: ElementGroupDataV1.optional()
|
|
2505
|
+
});
|
|
2506
|
+
var DocumentationPageV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementSlugPart.shape).extend({
|
|
2507
|
+
shortPersistentId: _zod.z.string(),
|
|
2508
|
+
data: DocumentationPageDataV2.extend({
|
|
2509
|
+
oldBlocks: _zod.z.array(PageBlockV1).optional()
|
|
2510
|
+
})
|
|
2511
|
+
});
|
|
2512
|
+
var FigmaFileStructureOrigin = _zod.z.object({
|
|
2513
|
+
sourceId: _zod.z.string(),
|
|
2514
|
+
fileId: _zod.z.string().optional()
|
|
2515
|
+
});
|
|
2516
|
+
var FigmaFileStructureData = _zod.z.object({
|
|
2517
|
+
rootNode: FigmaFileStructureNode,
|
|
2518
|
+
assetsInFile: FigmaFileStructureStatistics
|
|
2519
|
+
});
|
|
2520
|
+
var FigmaFileStructure = DesignElementBase.extend({
|
|
2521
|
+
origin: FigmaFileStructureOrigin,
|
|
2522
|
+
data: FigmaFileStructureData
|
|
2523
|
+
});
|
|
2524
|
+
var FigmaNodeReferenceOrigin = _zod.z.object({
|
|
2525
|
+
sourceId: _zod.z.string(),
|
|
2526
|
+
parentName: _zod.z.string().optional()
|
|
2527
|
+
});
|
|
2528
|
+
var FigmaNodeReference = DesignElementBase.extend({
|
|
2529
|
+
data: FigmaNodeReferenceData,
|
|
2530
|
+
origin: FigmaNodeReferenceOrigin
|
|
2531
|
+
});
|
|
2532
|
+
var DesignTokenOriginPart = _zod.z.object({
|
|
2533
|
+
referenceOriginId: _zod.z.string().optional(),
|
|
2534
|
+
referenceOriginKey: _zod.z.string().optional(),
|
|
2535
|
+
referencePersistentId: _zod.z.string().optional(),
|
|
2536
|
+
referenceResolutionFailed: _zod.z.boolean().optional(),
|
|
2537
|
+
key: _zod.z.string().optional()
|
|
2538
|
+
});
|
|
2539
|
+
var DesignTokenOrigin = DesignElementOrigin.extend(DesignTokenOriginPart.shape);
|
|
2540
|
+
var DesignTokenBase = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend(DesignElementBrandedPart.shape).extend({
|
|
2541
|
+
origin: DesignTokenOrigin.optional()
|
|
2542
|
+
});
|
|
2543
|
+
var CreateDesignTokenBase = DesignTokenBase.omit(zodCreateInputOmit());
|
|
2544
|
+
var UpdateDesignTokenBase = DesignTokenBase.omit({
|
|
2545
|
+
...zodUpdateInputOmit(),
|
|
2546
|
+
brandPersistentId: true,
|
|
2547
|
+
designSystemVersionId: true
|
|
2548
|
+
});
|
|
2549
|
+
var BlurTokenTypedData = _zod.z.object({
|
|
2550
|
+
type: _zod.z.literal("Blur"),
|
|
2551
|
+
data: BlurTokenData
|
|
2552
|
+
});
|
|
2553
|
+
var ColorTokenTypedData = _zod.z.object({
|
|
2554
|
+
type: _zod.z.literal("Color"),
|
|
2555
|
+
data: ColorTokenData
|
|
2556
|
+
});
|
|
2557
|
+
var GradientTokenTypedData = _zod.z.object({
|
|
2558
|
+
type: _zod.z.literal("Gradient"),
|
|
2559
|
+
data: GradientTokenData
|
|
2560
|
+
});
|
|
2561
|
+
var OpacityTokenTypedData = _zod.z.object({
|
|
2562
|
+
type: _zod.z.literal("Opacity"),
|
|
2563
|
+
data: OpacityTokenData
|
|
2564
|
+
});
|
|
2565
|
+
var ShadowTokenTypedData = _zod.z.object({
|
|
2566
|
+
type: _zod.z.literal("Shadow"),
|
|
2567
|
+
data: ShadowTokenData
|
|
2568
|
+
});
|
|
2569
|
+
var TypographyTokenTypedData = _zod.z.object({
|
|
2570
|
+
type: _zod.z.literal("Typography"),
|
|
2571
|
+
data: TypographyTokenData
|
|
2572
|
+
});
|
|
2573
|
+
var StringTokenTypedData = _zod.z.object({
|
|
2574
|
+
type: _zod.z.literal("String"),
|
|
2575
|
+
data: StringTokenData
|
|
2576
|
+
});
|
|
2577
|
+
var DimensionTokenTypedData = _zod.z.object({
|
|
2578
|
+
type: _zod.z.literal("Dimension"),
|
|
2579
|
+
data: DimensionTokenData
|
|
2580
|
+
});
|
|
2581
|
+
var FontSizeTokenTypedData = _zod.z.object({
|
|
2582
|
+
type: _zod.z.literal("FontSize"),
|
|
2583
|
+
data: FontSizeTokenData
|
|
2584
|
+
});
|
|
2585
|
+
var FontFamilyTokenTypedData = _zod.z.object({
|
|
2586
|
+
type: _zod.z.literal("FontFamily"),
|
|
2587
|
+
data: FontFamilyTokenData
|
|
2588
|
+
});
|
|
2589
|
+
var FontWeightTokenTypedData = _zod.z.object({
|
|
2590
|
+
type: _zod.z.literal("FontWeight"),
|
|
2591
|
+
data: FontWeightTokenData
|
|
2592
|
+
});
|
|
2593
|
+
var LetterSpacingTokenTypedData = _zod.z.object({
|
|
2594
|
+
type: _zod.z.literal("LetterSpacing"),
|
|
2595
|
+
data: LetterSpacingTokenData
|
|
2596
|
+
});
|
|
2597
|
+
var LineHeightTokenTypedData = _zod.z.object({
|
|
2598
|
+
type: _zod.z.literal("LineHeight"),
|
|
2599
|
+
data: LineHeightTokenData
|
|
2600
|
+
});
|
|
2601
|
+
var ParagraphSpacingTokenTypedData = _zod.z.object({
|
|
2602
|
+
type: _zod.z.literal("ParagraphSpacing"),
|
|
2603
|
+
data: ParagraphSpacingTokenData
|
|
2604
|
+
});
|
|
2605
|
+
var TextCaseTokenTypedData = _zod.z.object({
|
|
2606
|
+
type: _zod.z.literal("TextCase"),
|
|
2607
|
+
data: TextCaseTokenData
|
|
2608
|
+
});
|
|
2609
|
+
var TextDecorationTokenTypedData = _zod.z.object({
|
|
2610
|
+
type: _zod.z.literal("TextDecoration"),
|
|
2611
|
+
data: TextDecorationTokenData
|
|
2612
|
+
});
|
|
2613
|
+
var BorderRadiusTokenTypedData = _zod.z.object({
|
|
2614
|
+
type: _zod.z.literal("BorderRadius"),
|
|
2615
|
+
data: BorderRadiusTokenData
|
|
2616
|
+
});
|
|
2617
|
+
var BorderWidthTokenTypedData = _zod.z.object({
|
|
2618
|
+
type: _zod.z.literal("BorderWidth"),
|
|
2619
|
+
data: BorderWidthTokenData
|
|
2620
|
+
});
|
|
2621
|
+
var BorderTypedData = _zod.z.object({
|
|
2622
|
+
type: _zod.z.literal("Border"),
|
|
2623
|
+
data: BorderTokenData
|
|
2624
|
+
});
|
|
2625
|
+
var ProductCopyTypedData = _zod.z.object({
|
|
2626
|
+
type: _zod.z.literal("ProductCopy"),
|
|
2627
|
+
data: ProductCopyTokenData
|
|
2628
|
+
});
|
|
2629
|
+
var SizeTypedData = _zod.z.object({
|
|
2630
|
+
type: _zod.z.literal("Size"),
|
|
2631
|
+
data: SizeTokenData
|
|
2632
|
+
});
|
|
2633
|
+
var SpaceTypedData = _zod.z.object({
|
|
2634
|
+
type: _zod.z.literal("Space"),
|
|
2635
|
+
data: SpaceTokenData
|
|
2636
|
+
});
|
|
2637
|
+
var VisibilityTypedData = _zod.z.object({
|
|
2638
|
+
type: _zod.z.literal("Visibility"),
|
|
2639
|
+
data: VisibilityTokenData
|
|
2640
|
+
});
|
|
2641
|
+
var ZIndexTypedData = _zod.z.object({
|
|
2642
|
+
type: _zod.z.literal("ZIndex"),
|
|
2643
|
+
data: ZIndexTokenData
|
|
2644
|
+
});
|
|
2645
|
+
var DurationTypedData = _zod.z.object({
|
|
2646
|
+
type: _zod.z.literal("Duration"),
|
|
2647
|
+
data: DurationTokenData
|
|
2648
|
+
});
|
|
2649
|
+
var FontTypedData = _zod.z.object({
|
|
2650
|
+
type: _zod.z.literal("Font"),
|
|
2651
|
+
data: _zod.z.record(_zod.z.any())
|
|
2652
|
+
});
|
|
2653
|
+
var DesignTokenTypedData = _zod.z.discriminatedUnion("type", [
|
|
2654
|
+
BlurTokenTypedData,
|
|
2655
|
+
BorderRadiusTokenTypedData,
|
|
2656
|
+
BorderWidthTokenTypedData,
|
|
2657
|
+
BorderTypedData,
|
|
2658
|
+
ColorTokenTypedData,
|
|
2659
|
+
DimensionTokenTypedData,
|
|
2660
|
+
DurationTypedData,
|
|
2661
|
+
FontSizeTokenTypedData,
|
|
2662
|
+
FontFamilyTokenTypedData,
|
|
2663
|
+
FontWeightTokenTypedData,
|
|
2664
|
+
GradientTokenTypedData,
|
|
2665
|
+
LetterSpacingTokenTypedData,
|
|
2666
|
+
LineHeightTokenTypedData,
|
|
2667
|
+
OpacityTokenTypedData,
|
|
2668
|
+
ParagraphSpacingTokenTypedData,
|
|
2669
|
+
ProductCopyTypedData,
|
|
2670
|
+
ShadowTokenTypedData,
|
|
2671
|
+
SizeTypedData,
|
|
2672
|
+
SpaceTypedData,
|
|
2673
|
+
StringTokenTypedData,
|
|
2674
|
+
TextCaseTokenTypedData,
|
|
2675
|
+
TextDecorationTokenTypedData,
|
|
2676
|
+
TypographyTokenTypedData,
|
|
2677
|
+
VisibilityTypedData,
|
|
2678
|
+
ZIndexTypedData,
|
|
2679
|
+
FontTypedData
|
|
2680
|
+
]);
|
|
2681
|
+
var DesignToken = DesignTokenTypedData.and(DesignTokenBase);
|
|
2682
|
+
var CreateDesignToken = DesignTokenTypedData.and(CreateDesignTokenBase);
|
|
2683
|
+
var ThemeOverrideOriginPart = DesignTokenOriginPart;
|
|
2684
|
+
var ThemeOverrideOrigin = DesignTokenOrigin;
|
|
2685
|
+
var ThemeOverride = DesignTokenTypedData.and(
|
|
2686
|
+
_zod.z.object({
|
|
2687
|
+
tokenPersistentId: _zod.z.string(),
|
|
2688
|
+
origin: ThemeOverrideOrigin.optional().nullable().transform((v) => _nullishCoalesce(v, () => ( void 0)))
|
|
2689
|
+
})
|
|
2690
|
+
);
|
|
2691
|
+
var ThemeElementData = _zod.z.object({
|
|
2692
|
+
value: _zod.z.object({
|
|
2693
|
+
overrides: _zod.z.array(ThemeOverride)
|
|
2694
|
+
})
|
|
2695
|
+
});
|
|
2696
|
+
var ThemeOriginPart = _zod.z.object({});
|
|
2697
|
+
var ThemeOriginObject = _zod.z.object({
|
|
2698
|
+
id: _zod.z.string(),
|
|
2699
|
+
name: _zod.z.string()
|
|
2700
|
+
});
|
|
2701
|
+
var ThemeOriginSource = _zod.z.object({
|
|
2702
|
+
sourceId: _zod.z.string(),
|
|
2703
|
+
sourceObjects: _zod.z.array(ThemeOriginObject)
|
|
2704
|
+
});
|
|
2705
|
+
var ThemeOrigin = _zod.z.object({
|
|
2706
|
+
sources: _zod.z.array(ThemeOriginSource)
|
|
2707
|
+
});
|
|
2708
|
+
var Theme = DesignElementBase.extend(DesignElementBrandedPart.shape).extend({
|
|
2709
|
+
origin: ThemeOrigin.optional(),
|
|
2710
|
+
overrides: _zod.z.array(ThemeOverride),
|
|
2711
|
+
codeName: _zod.z.string()
|
|
2712
|
+
});
|
|
2713
|
+
function mapPageBlockItemValuesV2(pageItems, definitionsMap, fn) {
|
|
2714
|
+
traversePageBlockItemsV2(pageItems, (block, item) => {
|
|
2715
|
+
Object.entries(item.props).forEach(([propKey, value]) => {
|
|
2716
|
+
const property = definitionsMap.getDefinitionProperty(block.data.packageId, propKey);
|
|
2717
|
+
if (!property)
|
|
2718
|
+
return;
|
|
2719
|
+
item.props[propKey] = fn(block, item, property, value);
|
|
2720
|
+
});
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
function traversePageBlockItemsV2(pageItems, fn) {
|
|
2724
|
+
traversePageItemsV2(pageItems, (block) => {
|
|
2725
|
+
block.data.items.forEach((item) => {
|
|
2726
|
+
fn(block, item);
|
|
2727
|
+
});
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
function traversePageItemsV2(pageItems, fn) {
|
|
2731
|
+
for (const item of pageItems) {
|
|
2732
|
+
switch (item.type) {
|
|
2733
|
+
case "Block":
|
|
2734
|
+
fn(item);
|
|
2735
|
+
break;
|
|
2736
|
+
case "Section":
|
|
2737
|
+
item.items.forEach((i) => {
|
|
2738
|
+
i.columns.forEach((c) => {
|
|
2739
|
+
traversePageItemsV2(c.blocks, fn);
|
|
2740
|
+
});
|
|
2741
|
+
});
|
|
2742
|
+
break;
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
var PageBlockDefinitionsMap = class {
|
|
2747
|
+
constructor(definitions) {
|
|
2748
|
+
__publicField2(this, "definitionsMap", /* @__PURE__ */ new Map());
|
|
2749
|
+
__publicField2(this, "propertiesMap", /* @__PURE__ */ new Map());
|
|
2750
|
+
definitions.forEach((d) => {
|
|
2751
|
+
this.definitionsMap.set(d.id, d);
|
|
2752
|
+
d.item.properties.forEach((p) => {
|
|
2753
|
+
this.propertiesMap.set(this.propertyKey(d.id, p.id), p);
|
|
2754
|
+
});
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
getDefinition(id) {
|
|
2758
|
+
return this.definitionsMap.get(id);
|
|
2759
|
+
}
|
|
2760
|
+
getDefinitionProperty(defId, propId) {
|
|
2761
|
+
return this.propertiesMap.get(this.propertyKey(defId, propId));
|
|
2762
|
+
}
|
|
2763
|
+
propertyKey(defId, propId) {
|
|
2764
|
+
return `${defId}.${propId}`;
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
var FileStructureStats = _zod.z.object({
|
|
2768
|
+
frames: zeroNumberByDefault(),
|
|
2769
|
+
components: zeroNumberByDefault(),
|
|
2770
|
+
componentSets: zeroNumberByDefault()
|
|
2771
|
+
});
|
|
2772
|
+
var SourceImportSummaryByTokenTypeKey = DesignTokenType.or(
|
|
2773
|
+
// Backward compatibility
|
|
2774
|
+
_zod.z.enum(["Measure", "Radius", "GenericToken", "Font", "Text"])
|
|
2775
|
+
);
|
|
2776
|
+
var SourceImportSummaryByTokenType = _zod.z.record(SourceImportSummaryByTokenTypeKey, _zod.z.number());
|
|
2777
|
+
var SourceImportTokenSummary = _zod.z.object({
|
|
2778
|
+
tokensCreated: zeroNumberByDefault(),
|
|
2779
|
+
tokensUpdated: zeroNumberByDefault(),
|
|
2780
|
+
tokensDeleted: zeroNumberByDefault(),
|
|
2781
|
+
tokensCreatedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {}))),
|
|
2782
|
+
tokensUpdatedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {}))),
|
|
2783
|
+
tokensDeletedPerType: SourceImportSummaryByTokenType.nullish().transform((v) => _nullishCoalesce(v, () => ( {})))
|
|
2784
|
+
});
|
|
2785
|
+
var SourceImportComponentSummary = _zod.z.object({
|
|
2786
|
+
componentsCreated: zeroNumberByDefault(),
|
|
2787
|
+
componentsUpdated: zeroNumberByDefault(),
|
|
2788
|
+
componentsDeleted: zeroNumberByDefault(),
|
|
2789
|
+
componentAssetsCreated: zeroNumberByDefault(),
|
|
2790
|
+
componentAssetsUpdated: zeroNumberByDefault(),
|
|
2791
|
+
componentAssetsDeleted: zeroNumberByDefault()
|
|
2792
|
+
});
|
|
2793
|
+
var SourceImportFrameSummary = _zod.z.object({
|
|
2794
|
+
assetsInFile: nullishToOptional(FileStructureStats.optional()),
|
|
2795
|
+
invalidReferencesCount: nullishToOptional(_zod.z.number().optional())
|
|
2796
|
+
});
|
|
2797
|
+
var SourceImportSummary = _zod.z.object({
|
|
2798
|
+
sourceId: nullishToOptional(_zod.z.string()),
|
|
2799
|
+
brandId: nullishToOptional(_zod.z.string()),
|
|
2800
|
+
versionId: nullishToOptional(_zod.z.string()),
|
|
2801
|
+
error: nullishToOptional(_zod.z.any()),
|
|
2802
|
+
isFailed: _zod.z.boolean(),
|
|
2803
|
+
warnings: _zod.z.array(ImportWarning).nullish().transform((v) => _nullishCoalesce(v, () => ( []))),
|
|
2804
|
+
...SourceImportTokenSummary.shape,
|
|
2805
|
+
...SourceImportComponentSummary.shape,
|
|
2806
|
+
...FileStructureStats.shape
|
|
2807
|
+
});
|
|
2808
|
+
function zeroNumberByDefault() {
|
|
2809
|
+
return _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( 0)));
|
|
2810
|
+
}
|
|
2811
|
+
var DataSourceRemoteType = _zod.z.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
|
|
2812
|
+
var DataSourceUploadRemoteSource = _zod.z.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
|
|
2813
|
+
var DataSourceFigmaState = _zod.z.enum(["Active", "MissingIntegration", "MissingFileAccess", "MissingFileOwner"]);
|
|
2814
|
+
var DataSourceAutoImportMode = _zod.z.enum(["Never", "Hourly"]);
|
|
2815
|
+
var DataSourceStats = _zod.z.object({
|
|
2816
|
+
tokens: zeroNumberByDefault2(),
|
|
2817
|
+
components: zeroNumberByDefault2(),
|
|
2818
|
+
assets: zeroNumberByDefault2(),
|
|
2819
|
+
frames: zeroNumberByDefault2()
|
|
2820
|
+
});
|
|
2821
|
+
var DataSourceFigmaFileData = _zod.z.object({
|
|
2822
|
+
lastUpdatedAt: _zod.z.coerce.date()
|
|
2823
|
+
});
|
|
2824
|
+
var DataSourceFigmaFileVersionData = _zod.z.object({
|
|
2825
|
+
id: _zod.z.string(),
|
|
2826
|
+
label: _zod.z.string().optional(),
|
|
2827
|
+
description: _zod.z.string().optional(),
|
|
2828
|
+
createdAt: _zod.z.coerce.date()
|
|
2829
|
+
});
|
|
2830
|
+
var DataSourceFigmaScope = _zod.z.object({
|
|
2831
|
+
assets: _zod.z.boolean(),
|
|
2832
|
+
components: _zod.z.boolean(),
|
|
2833
|
+
documentationFrames: _zod.z.boolean(),
|
|
2834
|
+
tokens: _zod.z.boolean(),
|
|
2835
|
+
themePersistentId: _zod.z.string().optional(),
|
|
2836
|
+
isUnpublishedContentFallbackEnabled: _zod.z.boolean()
|
|
2837
|
+
});
|
|
2838
|
+
var DataSourceFigmaImportMetadata = _zod.z.object({
|
|
2839
|
+
fileData: DataSourceFigmaFileData.optional(),
|
|
2840
|
+
importedPublishedVersion: DataSourceFigmaFileVersionData.optional()
|
|
2841
|
+
});
|
|
2842
|
+
var DataSourceFigmaRemote = _zod.z.object({
|
|
2843
|
+
type: _zod.z.literal(DataSourceRemoteType.Enum.Figma),
|
|
2844
|
+
fileId: _zod.z.string(),
|
|
2845
|
+
preferredCredentialId: _zod.z.string().optional(),
|
|
2846
|
+
ownerId: _zod.z.string(),
|
|
2847
|
+
// todo remove or keep to reference who created data source
|
|
2848
|
+
ownerName: _zod.z.string(),
|
|
2849
|
+
// todo probably remove
|
|
2850
|
+
scope: DataSourceFigmaScope,
|
|
2851
|
+
state: DataSourceFigmaState,
|
|
2852
|
+
requiresSync: _zod.z.boolean().optional().transform((v) => _nullishCoalesce(v, () => ( false))),
|
|
2853
|
+
lastImportMetadata: DataSourceFigmaImportMetadata.optional(),
|
|
2854
|
+
downloadChunkSize: _zod.z.number().optional(),
|
|
2855
|
+
figmaRenderChunkSize: _zod.z.number().optional(),
|
|
2856
|
+
maxFileDepth: _zod.z.number().optional()
|
|
2857
|
+
});
|
|
2858
|
+
var DataSourceTokenStudioRemote = _zod.z.object({
|
|
2859
|
+
type: _zod.z.literal(DataSourceRemoteType.Enum.TokenStudio)
|
|
2860
|
+
});
|
|
2861
|
+
var DataSourceUploadImportMetadata = _zod.z.record(_zod.z.any());
|
|
2862
|
+
var DataSourceUploadRemote = _zod.z.object({
|
|
2863
|
+
type: _zod.z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
|
|
2864
|
+
remoteId: _zod.z.string(),
|
|
2865
|
+
remoteSourceType: DataSourceUploadRemoteSource,
|
|
2866
|
+
lastImportMetadata: DataSourceUploadImportMetadata.optional(),
|
|
2867
|
+
warnings: nullishToOptional(ImportWarning.array())
|
|
2868
|
+
});
|
|
2869
|
+
var DataSourceRemote = _zod.z.discriminatedUnion("type", [
|
|
2870
|
+
DataSourceFigmaRemote,
|
|
2871
|
+
DataSourceUploadRemote,
|
|
2872
|
+
DataSourceTokenStudioRemote
|
|
2873
|
+
]);
|
|
2874
|
+
var DataSource = _zod.z.object({
|
|
2875
|
+
id: _zod.z.string(),
|
|
2876
|
+
name: _zod.z.string(),
|
|
2877
|
+
thumbnailUrl: _zod.z.string().optional(),
|
|
2878
|
+
createdAt: _zod.z.coerce.date().optional(),
|
|
2879
|
+
lastImportedAt: _zod.z.coerce.date().optional(),
|
|
2880
|
+
lastImportSummary: SourceImportSummary.optional(),
|
|
2881
|
+
designSystemId: _zod.z.string(),
|
|
2882
|
+
brandPersistentId: _zod.z.string(),
|
|
2883
|
+
autoImportMode: DataSourceAutoImportMode,
|
|
2884
|
+
stats: DataSourceStats,
|
|
2885
|
+
remote: DataSourceRemote,
|
|
2886
|
+
sortOrder: _zod.z.number()
|
|
2887
|
+
});
|
|
2888
|
+
var DataSourceVersion = _zod.z.object({
|
|
2889
|
+
id: _zod.z.string(),
|
|
2890
|
+
createdAt: _zod.z.coerce.date(),
|
|
2891
|
+
label: _zod.z.string().nullish(),
|
|
2892
|
+
description: _zod.z.string().nullish()
|
|
2893
|
+
});
|
|
2894
|
+
function zeroNumberByDefault2() {
|
|
2895
|
+
return _zod.z.number().nullish().transform((v) => _nullishCoalesce(v, () => ( 0)));
|
|
2896
|
+
}
|
|
2897
|
+
var ImportJobState = _zod.z.enum(["PendingInput", "Queued", "InProgress", "Failed", "Success"]);
|
|
2898
|
+
var ImportJobOperation = _zod.z.enum(["Check", "Import"]);
|
|
2899
|
+
var ImportJob = Entity.extend({
|
|
2900
|
+
designSystemId: _zod.z.string(),
|
|
2901
|
+
designSystemVersionId: _zod.z.string(),
|
|
2902
|
+
sourceIds: _zod.z.array(_zod.z.string()),
|
|
2903
|
+
state: ImportJobState,
|
|
2904
|
+
createdByUserId: _zod.z.string().optional(),
|
|
2905
|
+
importContextId: _zod.z.string(),
|
|
2906
|
+
error: _zod.z.string().optional(),
|
|
2907
|
+
sourceType: DataSourceRemoteType,
|
|
2908
|
+
importContextCleanedUp: _zod.z.boolean()
|
|
2909
|
+
});
|
|
2910
|
+
var ImportFunctionInput = _zod.z.object({
|
|
2911
|
+
importJobId: _zod.z.string(),
|
|
2912
|
+
importContextId: _zod.z.string(),
|
|
2913
|
+
designSystemId: _zod.z.string().optional()
|
|
2914
|
+
});
|
|
2915
|
+
var ImportedFigmaSourceData = _zod.z.object({
|
|
2916
|
+
sourceId: _zod.z.string(),
|
|
2917
|
+
figmaRemote: DataSourceFigmaRemote
|
|
2918
|
+
});
|
|
2919
|
+
var FigmaImportBaseContext = _zod.z.object({
|
|
2920
|
+
designSystemId: _zod.z.string(),
|
|
2921
|
+
/**
|
|
2922
|
+
* Data required for accessing Figma files. This should contain access data for all file ids
|
|
2923
|
+
* mentioned in the `importedSourceDataBySourceId`
|
|
2924
|
+
*
|
|
2925
|
+
* fileId: file data
|
|
2926
|
+
*/
|
|
2927
|
+
fileAccessByFileId: _zod.z.record(FigmaFileAccessData),
|
|
2928
|
+
/**
|
|
2929
|
+
* Figma source data for which import was requested
|
|
2930
|
+
*
|
|
2931
|
+
* sourceId: source data
|
|
2932
|
+
*/
|
|
2933
|
+
importedSourceDataBySourceId: _zod.z.record(ImportedFigmaSourceData),
|
|
2934
|
+
/**
|
|
2935
|
+
* Array of warnings that will be written into the import result summary at the end
|
|
2936
|
+
* of import job execution and displayed by the client.
|
|
2937
|
+
*/
|
|
2938
|
+
importWarnings: _zod.z.record(ImportWarning.array()).default({})
|
|
2939
|
+
});
|
|
2940
|
+
var FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({
|
|
2941
|
+
sourcesWithMissingAccess: _zod.z.array(_zod.z.string()).default([]),
|
|
2942
|
+
shadowOpacityOptional: _zod.z.boolean().default(false)
|
|
2943
|
+
});
|
|
2944
|
+
var ChangedImportedFigmaSourceData = ImportedFigmaSourceData.extend({
|
|
2945
|
+
importMetadata: DataSourceFigmaImportMetadata
|
|
2946
|
+
});
|
|
2947
|
+
var FigmaImportContextWithDownloadScopes = FigmaImportContextWithSourcesState.extend({
|
|
2948
|
+
/**
|
|
2949
|
+
* Describes what to download from each file, this should contain all file id mentioned in
|
|
2950
|
+
* importMetadataBySourceId.
|
|
2951
|
+
*
|
|
2952
|
+
* File id -> file download scope
|
|
2953
|
+
*/
|
|
2954
|
+
fileDownloadScopesByFileId: _zod.z.record(FigmaFileDownloadScope),
|
|
2955
|
+
/**
|
|
2956
|
+
* Sources filtered down to the ones that have changed since last import and therefore need to be
|
|
2957
|
+
* imported again.
|
|
2958
|
+
*
|
|
2959
|
+
* Source id -> import metadata
|
|
2960
|
+
*/
|
|
2961
|
+
changedImportedSourceDataBySourceId: _zod.z.record(ChangedImportedFigmaSourceData)
|
|
2962
|
+
});
|
|
2963
|
+
var ImageImportModelType = _zod.z.enum(["Url", "FigmaRender"]);
|
|
2964
|
+
var ImageImportModelBase = _zod.z.object({
|
|
2965
|
+
scope: AssetScope
|
|
2966
|
+
});
|
|
2967
|
+
var UrlImageImportModel = ImageImportModelBase.extend({
|
|
2968
|
+
type: _zod.z.literal(ImageImportModelType.enum.Url),
|
|
2969
|
+
url: _zod.z.string(),
|
|
2970
|
+
originKey: _zod.z.string(),
|
|
2971
|
+
extension: _zod.z.string()
|
|
2972
|
+
});
|
|
2973
|
+
var FigmaRenderFormat = _zod.z.enum(["Svg", "Png", "Pdf"]);
|
|
2974
|
+
var FigmaRenderBase = ImageImportModelBase.extend({
|
|
2975
|
+
type: _zod.z.literal(ImageImportModelType.enum.FigmaRender),
|
|
2976
|
+
fileId: _zod.z.string(),
|
|
2977
|
+
fileVersionId: _zod.z.string().optional(),
|
|
2978
|
+
nodeId: _zod.z.string(),
|
|
2979
|
+
originKey: _zod.z.string()
|
|
2980
|
+
});
|
|
2981
|
+
var FigmaPngRenderImportModel = FigmaRenderBase.extend({
|
|
2982
|
+
format: _zod.z.literal(FigmaRenderFormat.enum.Png),
|
|
2983
|
+
scale: _zod.z.number()
|
|
2984
|
+
});
|
|
2985
|
+
var FigmaSvgRenderImportModel = FigmaRenderBase.extend({
|
|
2986
|
+
format: _zod.z.literal(FigmaRenderFormat.enum.Svg)
|
|
2987
|
+
});
|
|
2988
|
+
var FigmaRenderImportModel = _zod.z.discriminatedUnion("format", [
|
|
2989
|
+
FigmaPngRenderImportModel,
|
|
2990
|
+
FigmaSvgRenderImportModel
|
|
2991
|
+
]);
|
|
2992
|
+
var ImageImportModel = _zod.z.union([UrlImageImportModel, FigmaRenderImportModel]);
|
|
2993
|
+
var ImportModelBase = _zod.z.object({
|
|
2994
|
+
id: _zod.z.string(),
|
|
2995
|
+
meta: ObjectMeta,
|
|
2996
|
+
origin: DesignElementOrigin,
|
|
2997
|
+
brandPersistentId: _zod.z.string(),
|
|
2998
|
+
sortOrder: _zod.z.number()
|
|
2999
|
+
});
|
|
3000
|
+
var ImportModelInputBase = ImportModelBase.omit({
|
|
3001
|
+
brandPersistentId: true,
|
|
3002
|
+
origin: true,
|
|
3003
|
+
sortOrder: true
|
|
3004
|
+
}).extend({
|
|
3005
|
+
originId: _zod.z.string(),
|
|
3006
|
+
originMetadata: _zod.z.record(_zod.z.any())
|
|
3007
|
+
});
|
|
3008
|
+
var ComponentImportModelPart = _zod.z.object({
|
|
3009
|
+
thumbnail: ImageImportModel
|
|
3010
|
+
});
|
|
3011
|
+
var ComponentImportModel = ImportModelBase.extend(ComponentImportModelPart.shape).extend({
|
|
3012
|
+
isAsset: _zod.z.boolean(),
|
|
3013
|
+
svg: FigmaSvgRenderImportModel.optional(),
|
|
3014
|
+
origin: ComponentOrigin
|
|
3015
|
+
});
|
|
3016
|
+
var ComponentImportModelInput = ImportModelInputBase.extend(ComponentImportModelPart.shape).extend({
|
|
3017
|
+
originMetadata: ComponentOriginPart
|
|
3018
|
+
});
|
|
3019
|
+
var AssetImportModelInput = ImportModelInputBase.extend(ComponentImportModelPart.shape).extend({
|
|
3020
|
+
svg: FigmaSvgRenderImportModel,
|
|
3021
|
+
originMetadata: ComponentOriginPart
|
|
3022
|
+
});
|
|
3023
|
+
var ThemeOverrideImportModelBase = DesignTokenTypedData.and(
|
|
3024
|
+
_zod.z.object({
|
|
3025
|
+
id: _zod.z.string(),
|
|
3026
|
+
meta: ObjectMeta
|
|
3027
|
+
})
|
|
3028
|
+
);
|
|
3029
|
+
var ThemeOverrideImportModel = ThemeOverrideImportModelBase.and(
|
|
3030
|
+
_zod.z.object({
|
|
3031
|
+
origin: ThemeOverrideOrigin
|
|
3032
|
+
})
|
|
3033
|
+
);
|
|
3034
|
+
var ThemeOverrideImportModelInput = ThemeOverrideImportModelBase.and(
|
|
3035
|
+
_zod.z.object({
|
|
3036
|
+
originId: _zod.z.string(),
|
|
3037
|
+
originMetadata: ThemeOverrideOriginPart
|
|
3038
|
+
})
|
|
3039
|
+
);
|
|
3040
|
+
var ThemeImportModel = _zod.z.object({
|
|
3041
|
+
meta: ObjectMeta,
|
|
3042
|
+
brandPersistentId: _zod.z.string(),
|
|
3043
|
+
originSource: ThemeOriginSource,
|
|
3044
|
+
overrides: _zod.z.array(ThemeOverrideImportModel),
|
|
3045
|
+
sortOrder: _zod.z.number()
|
|
3046
|
+
});
|
|
3047
|
+
var ThemeImportModelInput = _zod.z.object({
|
|
3048
|
+
meta: ObjectMeta,
|
|
3049
|
+
originObjects: _zod.z.array(ThemeOriginObject),
|
|
3050
|
+
overrides: _zod.z.array(ThemeOverrideImportModelInput)
|
|
3051
|
+
});
|
|
3052
|
+
var ThemeUpdateImportModel = _zod.z.object({
|
|
3053
|
+
themePersistentId: _zod.z.string(),
|
|
3054
|
+
overrides: _zod.z.array(ThemeOverrideImportModel)
|
|
3055
|
+
});
|
|
3056
|
+
var ThemeUpdateImportModelInput = _zod.z.object({
|
|
3057
|
+
themePersistentId: _zod.z.string(),
|
|
3058
|
+
overrides: _zod.z.array(ThemeOverrideImportModelInput)
|
|
3059
|
+
});
|
|
3060
|
+
var DesignTokenImportModelPart = _zod.z.object({
|
|
3061
|
+
collection: _zod.z.string().optional(),
|
|
3062
|
+
codeSyntax: _zod.z.record(_zod.z.coerce.string()).optional()
|
|
3063
|
+
});
|
|
3064
|
+
var DesignTokenImportModelBase = ImportModelBase.extend(DesignTokenImportModelPart.shape).extend({
|
|
3065
|
+
origin: DesignTokenOrigin
|
|
3066
|
+
});
|
|
3067
|
+
var DesignTokenImportModelInputBase = ImportModelInputBase.extend(DesignTokenImportModelPart.shape).extend({
|
|
3068
|
+
originMetadata: DesignTokenOriginPart
|
|
3069
|
+
});
|
|
3070
|
+
var DesignTokenImportModel = DesignTokenTypedData.and(DesignTokenImportModelBase);
|
|
3071
|
+
var DesignTokenImportModelInput = DesignTokenTypedData.and(DesignTokenImportModelInputBase);
|
|
3072
|
+
var FigmaFileStructureNodeImportModelBase = FigmaFileStructureNodeBase.extend({
|
|
3073
|
+
image: FigmaPngRenderImportModel
|
|
3074
|
+
});
|
|
3075
|
+
var FigmaFileStructureNodeImportModel = FigmaFileStructureNodeImportModelBase.extend({
|
|
3076
|
+
children: _zod.z.lazy(() => FigmaFileStructureNodeImportModel.array())
|
|
3077
|
+
});
|
|
3078
|
+
var FigmaFileStructureImportModelPart = _zod.z.object({
|
|
3079
|
+
data: _zod.z.object({
|
|
3080
|
+
rootNode: FigmaFileStructureNodeImportModel,
|
|
3081
|
+
assetsInFile: FigmaFileStructureStatistics
|
|
3082
|
+
})
|
|
3083
|
+
});
|
|
3084
|
+
var FigmaFileStructureImportModel = ImportModelBase.extend(FigmaFileStructureImportModelPart.shape).extend({
|
|
3085
|
+
origin: FigmaFileStructureOrigin
|
|
3086
|
+
});
|
|
3087
|
+
var FigmaFileStructureImportModelInput = ImportModelInputBase.extend(
|
|
3088
|
+
FigmaFileStructureImportModelPart.shape
|
|
3089
|
+
).extend({
|
|
3090
|
+
fileVersionId: _zod.z.string()
|
|
3091
|
+
});
|
|
3092
|
+
var DataSourceImportModel = _zod.z.object({
|
|
3093
|
+
id: _zod.z.string(),
|
|
3094
|
+
fileName: _zod.z.string().optional(),
|
|
3095
|
+
thumbnailUrl: _zod.z.string().optional()
|
|
3096
|
+
});
|
|
3097
|
+
var ImportModelInputCollection = _zod.z.object({
|
|
3098
|
+
source: DataSourceImportModel,
|
|
3099
|
+
tokens: _zod.z.array(DesignTokenImportModelInput).default([]),
|
|
3100
|
+
components: _zod.z.array(ComponentImportModelInput).default([]),
|
|
3101
|
+
assets: _zod.z.array(AssetImportModelInput).default([]),
|
|
3102
|
+
themeUpdates: _zod.z.array(ThemeUpdateImportModelInput).default([]),
|
|
3103
|
+
themes: _zod.z.array(ThemeImportModelInput).default([]),
|
|
3104
|
+
figmaFileStructure: FigmaFileStructureImportModelInput.optional()
|
|
3105
|
+
});
|
|
3106
|
+
var ImportModelCollection = _zod.z.object({
|
|
3107
|
+
sources: _zod.z.array(DataSourceImportModel),
|
|
3108
|
+
tokens: _zod.z.array(DesignTokenImportModel).default([]),
|
|
3109
|
+
components: _zod.z.array(ComponentImportModel).default([]),
|
|
3110
|
+
themeUpdates: _zod.z.array(ThemeUpdateImportModel).default([]),
|
|
3111
|
+
themes: _zod.z.array(ThemeImportModel).default([]),
|
|
3112
|
+
figmaFileStructures: _zod.z.array(FigmaFileStructureImportModel)
|
|
3113
|
+
});
|
|
3114
|
+
var AssetRenderConfiguration = _zod.z.object({
|
|
3115
|
+
prefix: _zod.z.string().optional(),
|
|
3116
|
+
suffix: _zod.z.string().optional(),
|
|
3117
|
+
scale: _zod.z.number(),
|
|
3118
|
+
format: FigmaRenderFormat
|
|
3119
|
+
});
|
|
3120
|
+
var RenderedAssetFile = _zod.z.object({
|
|
3121
|
+
assetPersistentId: _zod.z.string(),
|
|
3122
|
+
assetName: _zod.z.string(),
|
|
3123
|
+
renderedImageFileName: _zod.z.string(),
|
|
3124
|
+
renderedImageUrl: _zod.z.string(),
|
|
3125
|
+
settings: AssetRenderConfiguration
|
|
3126
|
+
});
|
|
3127
|
+
var PageBlockDefinitionAppearance = _zod.z.object({
|
|
3128
|
+
isBordered: _zod.z.boolean().optional(),
|
|
3129
|
+
hasBackground: _zod.z.boolean().optional(),
|
|
3130
|
+
isEditorPresentationDifferent: _zod.z.boolean().optional(),
|
|
3131
|
+
showBlockHeaderInEditor: _zod.z.boolean().optional()
|
|
3132
|
+
});
|
|
3133
|
+
var PageBlockDefinitionLayoutType = _zod.z.enum(["Column", "Row"]);
|
|
3134
|
+
var PageBlockDefinitionLayoutGap = _zod.z.enum(["Small", "Medium", "Large", "None"]);
|
|
3135
|
+
var PageBlockDefinitionLayoutAlign = _zod.z.enum(["Start", "Center", "End"]);
|
|
3136
|
+
var PageBlockDefinitionLayoutResizing = _zod.z.enum(["Fill", "Hug"]);
|
|
3137
|
+
var PageBlockDefinitionLayoutBase = _zod.z.object({
|
|
3138
|
+
type: PageBlockDefinitionLayoutType,
|
|
3139
|
+
gap: PageBlockDefinitionLayoutGap.optional(),
|
|
3140
|
+
columnAlign: PageBlockDefinitionLayoutAlign.optional(),
|
|
3141
|
+
columnResizing: PageBlockDefinitionLayoutResizing.optional()
|
|
3142
|
+
});
|
|
3143
|
+
var PageBlockDefinitionLayout = PageBlockDefinitionLayoutBase.extend({
|
|
3144
|
+
children: _zod.z.lazy(() => _zod.z.array(PageBlockDefinitionLayout.or(_zod.z.string())))
|
|
3145
|
+
});
|
|
3146
|
+
var PageBlockDefinitionVariant = _zod.z.object({
|
|
3147
|
+
id: _zod.z.string(),
|
|
3148
|
+
name: _zod.z.string(),
|
|
3149
|
+
image: _zod.z.string().optional(),
|
|
3150
|
+
description: _zod.z.string().optional(),
|
|
3151
|
+
documentationLink: _zod.z.string().optional(),
|
|
3152
|
+
layout: PageBlockDefinitionLayout,
|
|
3153
|
+
maxColumns: _zod.z.number().optional(),
|
|
3154
|
+
defaultColumns: _zod.z.number().optional(),
|
|
3155
|
+
appearance: PageBlockDefinitionAppearance.optional()
|
|
3156
|
+
});
|
|
3157
|
+
var PageBlockDefinitionPropertyType = _zod.z.enum([
|
|
3158
|
+
"RichText",
|
|
3159
|
+
"MultiRichText",
|
|
3160
|
+
"Text",
|
|
3161
|
+
"Boolean",
|
|
3162
|
+
"Number",
|
|
3163
|
+
"SingleSelect",
|
|
3164
|
+
"MultiSelect",
|
|
3165
|
+
"Image",
|
|
3166
|
+
"Token",
|
|
3167
|
+
"TokenType",
|
|
3168
|
+
"TokenProperty",
|
|
3169
|
+
"Component",
|
|
3170
|
+
"ComponentProperty",
|
|
3171
|
+
"Asset",
|
|
3172
|
+
"AssetProperty",
|
|
3173
|
+
"FigmaNode",
|
|
3174
|
+
"EmbedURL",
|
|
3175
|
+
"URL",
|
|
3176
|
+
"Markdown",
|
|
3177
|
+
"Code",
|
|
3178
|
+
"CodeSandbox",
|
|
3179
|
+
"Table",
|
|
3180
|
+
"Divider",
|
|
3181
|
+
"Storybook",
|
|
3182
|
+
"Color",
|
|
3183
|
+
"FigmaComponent"
|
|
3184
|
+
]);
|
|
3185
|
+
var PageBlockDefinitionRichTextPropertyStyle = _zod.z.enum([
|
|
3186
|
+
"Title1",
|
|
3187
|
+
"Title2",
|
|
3188
|
+
"Title3",
|
|
3189
|
+
"Title4",
|
|
3190
|
+
"Title5",
|
|
3191
|
+
"Quote",
|
|
3192
|
+
"Callout",
|
|
3193
|
+
"Default"
|
|
3194
|
+
]);
|
|
3195
|
+
var PageBlockDefinitionMultiRichTextPropertyStyle = _zod.z.enum(["OL", "UL", "Default"]);
|
|
3196
|
+
var PageBlockDefinitionTextPropertyStyle = _zod.z.enum([
|
|
3197
|
+
"Title1",
|
|
3198
|
+
"Title2",
|
|
3199
|
+
"Title3",
|
|
3200
|
+
"Title4",
|
|
3201
|
+
"Title5",
|
|
3202
|
+
"Default",
|
|
3203
|
+
"DefaultBold",
|
|
3204
|
+
"DefaultSemibold",
|
|
3205
|
+
"Small",
|
|
3206
|
+
"SmallBold",
|
|
3207
|
+
"SmallSemibold",
|
|
3208
|
+
"Custom"
|
|
3209
|
+
]);
|
|
3210
|
+
var PageBlockDefinitionTextPropertyColor = _zod.z.enum(["Neutral", "NeutralFaded"]);
|
|
3211
|
+
var PageBlockDefinitionBooleanPropertyStyle = _zod.z.enum(["SegmentedControl", "ToggleButton", "Checkbox"]);
|
|
3212
|
+
var PageBlockDefinitionSingleSelectPropertyStyle = _zod.z.enum([
|
|
3213
|
+
"SegmentedControl",
|
|
3214
|
+
"ToggleButton",
|
|
3215
|
+
"Select",
|
|
3216
|
+
"Checkbox"
|
|
3217
|
+
]);
|
|
3218
|
+
var PageBlockDefinitionSingleSelectPropertyColor = _zod.z.enum([
|
|
3219
|
+
"Green",
|
|
3220
|
+
"Red",
|
|
3221
|
+
"Yellow",
|
|
3222
|
+
"Blue",
|
|
3223
|
+
"Purple",
|
|
3224
|
+
"Orange",
|
|
3225
|
+
"Pink",
|
|
3226
|
+
"Teal",
|
|
3227
|
+
"Brown",
|
|
3228
|
+
"Grey",
|
|
3229
|
+
"LightGrey",
|
|
3230
|
+
"Cyan",
|
|
3231
|
+
"Fuchsia"
|
|
3232
|
+
]);
|
|
3233
|
+
var IconSet = _zod.z.enum([
|
|
3234
|
+
"CheckCircle",
|
|
3235
|
+
"CrossCircle",
|
|
3236
|
+
"Alert"
|
|
3237
|
+
]);
|
|
3238
|
+
var PageBlockDefinitionMultiSelectPropertyStyle = _zod.z.enum(["SegmentedControl", "Select", "Checkbox"]);
|
|
3239
|
+
var PageBlockDefinitionImageAspectRatio = _zod.z.enum(["Auto", "Square", "Landscape", "Portrait", "Wide"]);
|
|
3240
|
+
var PageBlockDefinitionImageWidth = _zod.z.enum(["Full", "Icon", "Small", "Medium", "Large", "Poster"]);
|
|
3241
|
+
var PageBlockDefinitionSelectChoice = _zod.z.object({
|
|
3242
|
+
value: _zod.z.string(),
|
|
3243
|
+
name: _zod.z.string(),
|
|
3244
|
+
icon: IconSet.optional(),
|
|
3245
|
+
customIconUrl: _zod.z.string().optional(),
|
|
3246
|
+
color: PageBlockDefinitionSingleSelectPropertyColor.optional()
|
|
3247
|
+
});
|
|
3248
|
+
var PageBlockDefinitionUntypedPropertyOptions = _zod.z.record(_zod.z.any());
|
|
3249
|
+
var PageBlockDefinitionRichTextOptions = _zod.z.object({
|
|
3250
|
+
richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional()
|
|
3251
|
+
});
|
|
3252
|
+
var PageBlockDefinitionMutiRichTextOptions = _zod.z.object({
|
|
3253
|
+
multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional()
|
|
3254
|
+
});
|
|
3255
|
+
var PageBlockDefinitionTextOptions = _zod.z.object({
|
|
3256
|
+
placeholder: _zod.z.string().optional(),
|
|
3257
|
+
defaultValue: _zod.z.string().optional(),
|
|
3258
|
+
textStyle: PageBlockDefinitionTextPropertyStyle.optional(),
|
|
3259
|
+
color: PageBlockDefinitionTextPropertyColor.optional(),
|
|
3260
|
+
allowLineBreaks: _zod.z.boolean().optional()
|
|
3261
|
+
});
|
|
3262
|
+
var PageBlockDefinitionSelectOptions = _zod.z.object({
|
|
3263
|
+
singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),
|
|
3264
|
+
defaultChoice: _zod.z.string(),
|
|
3265
|
+
choices: _zod.z.array(PageBlockDefinitionSelectChoice)
|
|
3266
|
+
});
|
|
3267
|
+
var PageBlockDefinitionImageOptions = _zod.z.object({
|
|
3268
|
+
width: PageBlockDefinitionImageWidth.optional(),
|
|
3269
|
+
aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),
|
|
3270
|
+
allowCaption: _zod.z.boolean().optional(),
|
|
3271
|
+
recommendation: _zod.z.string().optional()
|
|
3272
|
+
});
|
|
3273
|
+
var PageBlockDefinitionBooleanOptions = _zod.z.object({
|
|
3274
|
+
defaultvalue: _zod.z.boolean().optional(),
|
|
3275
|
+
booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional()
|
|
3276
|
+
});
|
|
3277
|
+
var PageBlockDefinitionNumberOptions = _zod.z.object({
|
|
3278
|
+
defaultValue: _zod.z.number(),
|
|
3279
|
+
min: _zod.z.number().optional(),
|
|
3280
|
+
max: _zod.z.number().optional(),
|
|
3281
|
+
step: _zod.z.number().optional(),
|
|
3282
|
+
placeholder: _zod.z.string().optional()
|
|
3283
|
+
});
|
|
3284
|
+
var PageBlockDefinitionComponentOptions = _zod.z.object({
|
|
3285
|
+
renderLayoutAs: _zod.z.enum(["List", "Table"]).optional(),
|
|
3286
|
+
allowPropertySelection: _zod.z.boolean().optional()
|
|
3287
|
+
});
|
|
3288
|
+
var PageBlockDefinitionProperty = _zod.z.object({
|
|
3289
|
+
id: _zod.z.string(),
|
|
3290
|
+
name: _zod.z.string(),
|
|
3291
|
+
type: PageBlockDefinitionPropertyType,
|
|
3292
|
+
description: _zod.z.string().optional(),
|
|
3293
|
+
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
3294
|
+
variantOptions: _zod.z.record(PageBlockDefinitionUntypedPropertyOptions).optional()
|
|
3295
|
+
});
|
|
3296
|
+
var PageBlockDefinitionItem = _zod.z.object({
|
|
3297
|
+
properties: _zod.z.array(PageBlockDefinitionProperty),
|
|
3298
|
+
appearance: PageBlockDefinitionAppearance.optional(),
|
|
3299
|
+
variants: _zod.z.array(PageBlockDefinitionVariant),
|
|
3300
|
+
defaultVariantKey: _zod.z.string()
|
|
3301
|
+
});
|
|
3302
|
+
var PageBlockCategory = _zod.z.enum([
|
|
3303
|
+
"Text",
|
|
3304
|
+
"Layout",
|
|
3305
|
+
"Media",
|
|
3306
|
+
"Embed",
|
|
3307
|
+
"Figma",
|
|
3308
|
+
"Code",
|
|
3309
|
+
"Guidelines",
|
|
3310
|
+
"Tokens",
|
|
3311
|
+
"Components",
|
|
3312
|
+
"Assets",
|
|
3313
|
+
"Data",
|
|
3314
|
+
"Other"
|
|
3315
|
+
]);
|
|
3316
|
+
var PageBlockBehaviorDataType = _zod.z.enum(["Item", "Token", "Asset", "Component", "FigmaNode", "FigmaComponent"]);
|
|
3317
|
+
var PageBlockBehaviorSelectionType = _zod.z.enum(["Entity", "Group", "EntityAndGroup"]);
|
|
3318
|
+
var PageBlockDefinitionBehavior = _zod.z.object({
|
|
3319
|
+
dataType: PageBlockBehaviorDataType,
|
|
3320
|
+
items: _zod.z.object({
|
|
3321
|
+
numberOfItems: _zod.z.number(),
|
|
3322
|
+
allowLinks: _zod.z.boolean(),
|
|
3323
|
+
newItemLabel: _zod.z.string().optional()
|
|
3324
|
+
}).optional(),
|
|
3325
|
+
entities: _zod.z.object({
|
|
3326
|
+
selectionType: PageBlockBehaviorSelectionType,
|
|
3327
|
+
maxSelected: _zod.z.number()
|
|
3328
|
+
}).optional()
|
|
3329
|
+
});
|
|
3330
|
+
var PageBlockDefinitionOnboarding = _zod.z.object({
|
|
3331
|
+
helpText: _zod.z.string(),
|
|
3332
|
+
documentationLink: _zod.z.string().optional()
|
|
3333
|
+
});
|
|
3334
|
+
var PageBlockDefinition = _zod.z.object({
|
|
3335
|
+
id: _zod.z.string(),
|
|
3336
|
+
name: _zod.z.string(),
|
|
3337
|
+
description: _zod.z.string(),
|
|
3338
|
+
category: PageBlockCategory,
|
|
3339
|
+
icon: _zod.z.string().optional(),
|
|
3340
|
+
documentationLink: _zod.z.string().optional(),
|
|
3341
|
+
searchKeywords: _zod.z.array(_zod.z.string()).optional(),
|
|
3342
|
+
item: PageBlockDefinitionItem,
|
|
3343
|
+
behavior: PageBlockDefinitionBehavior,
|
|
3344
|
+
editorOptions: _zod.z.object({
|
|
3345
|
+
onboarding: PageBlockDefinitionOnboarding.optional(),
|
|
3346
|
+
newItemLabel: _zod.z.string().optional()
|
|
3347
|
+
}),
|
|
3348
|
+
appearance: PageBlockDefinitionAppearance.optional()
|
|
3349
|
+
});
|
|
3350
|
+
var DocumentationPageGroup = _zod.z.object({
|
|
3351
|
+
type: _zod.z.literal("ElementGroup"),
|
|
3352
|
+
childType: _zod.z.literal("DocumentationPage"),
|
|
3353
|
+
id: _zod.z.string(),
|
|
3354
|
+
persistentId: _zod.z.string(),
|
|
3355
|
+
shortPersistentId: _zod.z.string(),
|
|
3356
|
+
designSystemVersionId: _zod.z.string(),
|
|
3357
|
+
parentPersistentId: _zod.z.string().nullish(),
|
|
3358
|
+
sortOrder: _zod.z.number(),
|
|
3359
|
+
title: _zod.z.string(),
|
|
3360
|
+
slug: _zod.z.string(),
|
|
3361
|
+
userSlug: _zod.z.string().nullish(),
|
|
3362
|
+
createdAt: _zod.z.coerce.date(),
|
|
3363
|
+
updatedAt: _zod.z.coerce.date()
|
|
3364
|
+
});
|
|
3365
|
+
var DocumentationLinkPreview = _zod.z.object({
|
|
3366
|
+
title: _zod.z.string().optional(),
|
|
3367
|
+
description: _zod.z.string().optional(),
|
|
3368
|
+
thumbnail: PageBlockImageReference.optional()
|
|
3369
|
+
});
|
|
3370
|
+
var DocumentationPageAnchor = _zod.z.object({
|
|
3371
|
+
blockId: _zod.z.string(),
|
|
3372
|
+
level: _zod.z.number(),
|
|
3373
|
+
text: _zod.z.string()
|
|
3374
|
+
});
|
|
3375
|
+
var DocumentationPageContentBackup = _zod.z.object({
|
|
3376
|
+
id: _zod.z.string(),
|
|
3377
|
+
designSystemVersionId: _zod.z.string(),
|
|
3378
|
+
createdAt: _zod.z.coerce.date(),
|
|
3379
|
+
updatedAt: _zod.z.coerce.date(),
|
|
3380
|
+
documentationPageId: _zod.z.string(),
|
|
3381
|
+
documentationPageName: _zod.z.string(),
|
|
3382
|
+
storagePath: _zod.z.string()
|
|
3383
|
+
});
|
|
3384
|
+
var DocumentationPageContentItem = _zod.z.discriminatedUnion("type", [
|
|
3385
|
+
PageBlockEditorModelV2,
|
|
3386
|
+
PageSectionEditorModelV2
|
|
3387
|
+
]);
|
|
3388
|
+
var DocumentationPageContentData = _zod.z.object({
|
|
3389
|
+
items: _zod.z.array(DocumentationPageContentItem)
|
|
3390
|
+
});
|
|
3391
|
+
var DocumentationPageContent = _zod.z.object({
|
|
3392
|
+
id: _zod.z.string(),
|
|
3393
|
+
designSystemVersionId: _zod.z.string(),
|
|
3394
|
+
createdAt: _zod.z.coerce.date(),
|
|
3395
|
+
updatedAt: _zod.z.coerce.date(),
|
|
3396
|
+
documentationPageId: _zod.z.string(),
|
|
3397
|
+
data: DocumentationPageContentData
|
|
3398
|
+
});
|
|
3399
|
+
var DocumentationPage = _zod.z.object({
|
|
3400
|
+
type: _zod.z.literal("DocumentationPage"),
|
|
3401
|
+
id: _zod.z.string(),
|
|
3402
|
+
persistentId: _zod.z.string(),
|
|
3403
|
+
shortPersistentId: _zod.z.string(),
|
|
3404
|
+
designSystemVersionId: _zod.z.string(),
|
|
3405
|
+
parentPersistentId: _zod.z.string().nullish(),
|
|
3406
|
+
sortOrder: _zod.z.number(),
|
|
3407
|
+
title: _zod.z.string(),
|
|
3408
|
+
slug: _zod.z.string(),
|
|
3409
|
+
userSlug: _zod.z.string().nullish(),
|
|
3410
|
+
createdAt: _zod.z.coerce.date(),
|
|
3411
|
+
updatedAt: _zod.z.coerce.date()
|
|
3412
|
+
});
|
|
3413
|
+
var DocumentationComment = _zod.z.object({
|
|
3414
|
+
id: _zod.z.string(),
|
|
3415
|
+
authorId: _zod.z.string(),
|
|
3416
|
+
threadId: _zod.z.string(),
|
|
3417
|
+
roomId: _zod.z.string(),
|
|
3418
|
+
createdAt: _zod.z.coerce.date(),
|
|
3419
|
+
editedAt: _zod.z.coerce.date().optional(),
|
|
3420
|
+
deletedAt: _zod.z.coerce.date().optional(),
|
|
3421
|
+
body: _zod.z.string()
|
|
3422
|
+
});
|
|
3423
|
+
var DocumentationCommentThread = _zod.z.object({
|
|
3424
|
+
id: _zod.z.string(),
|
|
3425
|
+
roomId: _zod.z.string(),
|
|
3426
|
+
pagePersistentId: _zod.z.string(),
|
|
3427
|
+
brandId: _zod.z.string(),
|
|
3428
|
+
designSystemVersionId: _zod.z.string(),
|
|
3429
|
+
designSystemId: _zod.z.string(),
|
|
3430
|
+
blockId: _zod.z.string().optional(),
|
|
3431
|
+
resolved: _zod.z.boolean(),
|
|
3432
|
+
createdAt: _zod.z.coerce.date(),
|
|
3433
|
+
updatedAt: _zod.z.coerce.date()
|
|
3434
|
+
});
|
|
3284
3435
|
var DesignElementSnapshotReason = _zod.z.enum(["Publish", "Deletion"]);
|
|
3285
3436
|
var DesignElementSnapshotBase = _zod.z.object({
|
|
3286
3437
|
id: _zod.z.string(),
|
|
@@ -6194,9 +6345,10 @@ var VersionRoomBaseYDoc = class {
|
|
|
6194
6345
|
};
|
|
6195
6346
|
|
|
6196
6347
|
// src/yjs/version-room/utils.ts
|
|
6197
|
-
function generatePageContentHash(content, debug = false) {
|
|
6348
|
+
function generatePageContentHash(content, definitions, debug = false) {
|
|
6198
6349
|
let sanitizedContent = content;
|
|
6199
|
-
|
|
6350
|
+
sanitizedContent = removeCommentSpansFromPage(content, definitions);
|
|
6351
|
+
if (isPageContentEmpty(sanitizedContent)) {
|
|
6200
6352
|
sanitizedContent = { blocks: [] };
|
|
6201
6353
|
}
|
|
6202
6354
|
return generateHash(sanitizedContent, debug);
|
|
@@ -6216,6 +6368,27 @@ function isPageContentEmpty(content) {
|
|
|
6216
6368
|
const textValue = singleItem.props["text"];
|
|
6217
6369
|
return !textValue.value.spans.length;
|
|
6218
6370
|
}
|
|
6371
|
+
function removeCommentSpansFromPage(content, definitions) {
|
|
6372
|
+
const defMap = new PageBlockDefinitionsMap(definitions);
|
|
6373
|
+
mapPageBlockItemValuesV2(content.blocks, defMap, (block, item, prop, value) => {
|
|
6374
|
+
if (prop.type === "RichText") {
|
|
6375
|
+
const richTextValue = value;
|
|
6376
|
+
return {
|
|
6377
|
+
...richTextValue,
|
|
6378
|
+
value: removeCommentSpans(richTextValue.value)
|
|
6379
|
+
};
|
|
6380
|
+
}
|
|
6381
|
+
if (prop.type === "MultiRichText") {
|
|
6382
|
+
const multiRichTextValue = value;
|
|
6383
|
+
return {
|
|
6384
|
+
...multiRichTextValue,
|
|
6385
|
+
value: multiRichTextValue.value.map(removeCommentSpans)
|
|
6386
|
+
};
|
|
6387
|
+
}
|
|
6388
|
+
return value;
|
|
6389
|
+
});
|
|
6390
|
+
return content;
|
|
6391
|
+
}
|
|
6219
6392
|
|
|
6220
6393
|
// src/yjs/version-room/frontend.ts
|
|
6221
6394
|
var FrontendVersionRoomYDoc = class {
|
|
@@ -6453,8 +6626,8 @@ var FrontendVersionRoomYDoc = class {
|
|
|
6453
6626
|
//
|
|
6454
6627
|
// Update page content hash
|
|
6455
6628
|
//
|
|
6456
|
-
notifyDocumentationPageContentUpdated(pageId, content) {
|
|
6457
|
-
const pageContentHash = generatePageContentHash(content, this.debug);
|
|
6629
|
+
notifyDocumentationPageContentUpdated(pageId, content, definitions) {
|
|
6630
|
+
const pageContentHash = generatePageContentHash(content, definitions, this.debug);
|
|
6458
6631
|
if (this.debug) {
|
|
6459
6632
|
console.log(`Will set page content hash: '${pageId}' : '${pageContentHash}'`);
|
|
6460
6633
|
}
|