@supernova-studio/model 0.47.57 → 0.47.59
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 +3724 -4273
- package/dist/index.d.ts +3724 -4273
- package/dist/index.js +88 -76
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -99
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/documentation/block-definitions/definition.ts +2 -3
- package/src/dsm/element-snapshots/base.ts +1 -0
- package/src/dsm/elements/data/documentation-block-v1.ts +16 -3
- package/src/liveblocks/rooms/design-system-version-room.ts +6 -8
package/dist/index.mjs
CHANGED
|
@@ -610,9 +610,76 @@ var ComponentElementData = z32.object({
|
|
|
610
610
|
// src/dsm/elements/data/documentation-block-v1.ts
|
|
611
611
|
import { z as z38 } from "zod";
|
|
612
612
|
|
|
613
|
-
// src/dsm/
|
|
613
|
+
// src/dsm/properties/property-definition.ts
|
|
614
614
|
import { z as z33 } from "zod";
|
|
615
|
-
var
|
|
615
|
+
var ElementPropertyTypeSchema = z33.enum(["Text", "Number", "Boolean", "Select", "Generic", "Link", "URL"]);
|
|
616
|
+
var ElementPropertyTargetType = z33.enum(["Token", "Component", "DocumentationPage"]);
|
|
617
|
+
var ElementPropertyLinkType = z33.enum(["FigmaComponent", "DocumentationPage"]);
|
|
618
|
+
var CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
|
|
619
|
+
var ColorTokenInlineData = z33.object({
|
|
620
|
+
value: z33.string()
|
|
621
|
+
});
|
|
622
|
+
var ElementPropertyDefinitionOption = z33.object({
|
|
623
|
+
id: z33.string(),
|
|
624
|
+
name: z33.string(),
|
|
625
|
+
backgroundColor: ColorTokenInlineData.optional()
|
|
626
|
+
});
|
|
627
|
+
var ElementPropertyDefinition = z33.object({
|
|
628
|
+
id: z33.string(),
|
|
629
|
+
designSystemVersionId: z33.string(),
|
|
630
|
+
persistentId: z33.string(),
|
|
631
|
+
name: z33.string(),
|
|
632
|
+
codeName: z33.string().regex(CODE_NAME_REGEX),
|
|
633
|
+
description: z33.string(),
|
|
634
|
+
type: ElementPropertyTypeSchema,
|
|
635
|
+
targetElementType: ElementPropertyTargetType,
|
|
636
|
+
options: z33.array(ElementPropertyDefinitionOption).optional(),
|
|
637
|
+
linkElementType: ElementPropertyLinkType.optional()
|
|
638
|
+
});
|
|
639
|
+
var ElementPropertyType = ElementPropertyTypeSchema.enum;
|
|
640
|
+
|
|
641
|
+
// src/dsm/properties/property-value.ts
|
|
642
|
+
import { z as z34 } from "zod";
|
|
643
|
+
var ElementPropertyValue = z34.object({
|
|
644
|
+
id: z34.string(),
|
|
645
|
+
designSystemVersionId: z34.string(),
|
|
646
|
+
targetElementPersistentId: z34.string(),
|
|
647
|
+
definitionPersistentId: z34.string(),
|
|
648
|
+
stringValue: z34.string().nullish(),
|
|
649
|
+
numberValue: z34.number().nullish(),
|
|
650
|
+
booleanValue: z34.boolean().nullish(),
|
|
651
|
+
referenceValue: z34.string().nullish(),
|
|
652
|
+
referenceValuePreview: z34.string().optional()
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
// src/dsm/elements/primitives/point.ts
|
|
656
|
+
import { z as z35 } from "zod";
|
|
657
|
+
var Point2D = z35.object({
|
|
658
|
+
x: z35.number(),
|
|
659
|
+
y: z35.number()
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
// src/dsm/elements/primitives/size.ts
|
|
663
|
+
import { z as z36 } from "zod";
|
|
664
|
+
var nullSize = { height: -1, width: -1 };
|
|
665
|
+
function isNullSize(size) {
|
|
666
|
+
return size.height === nullSize.height && size.width === nullSize.width;
|
|
667
|
+
}
|
|
668
|
+
var Size = z36.object({
|
|
669
|
+
width: z36.number().nullish().transform((v) => v ?? nullSize.width),
|
|
670
|
+
height: z36.number().nullish().transform((v) => v ?? nullSize.height)
|
|
671
|
+
});
|
|
672
|
+
var SizeOrUndefined = Size.optional().transform((v) => {
|
|
673
|
+
if (!v)
|
|
674
|
+
return void 0;
|
|
675
|
+
if (isNullSize(v))
|
|
676
|
+
return void 0;
|
|
677
|
+
return v;
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// src/dsm/elements/raw-element.ts
|
|
681
|
+
import { z as z37 } from "zod";
|
|
682
|
+
var DesignTokenType = z37.enum([
|
|
616
683
|
"Color",
|
|
617
684
|
"Border",
|
|
618
685
|
"Gradient",
|
|
@@ -644,7 +711,7 @@ var DesignTokenType = z33.enum([
|
|
|
644
711
|
]);
|
|
645
712
|
var tokenElementTypes = [...DesignTokenType.options.filter((v) => v !== "Font")];
|
|
646
713
|
var DesignElementType = DesignTokenType.or(
|
|
647
|
-
|
|
714
|
+
z37.enum([
|
|
648
715
|
"Component",
|
|
649
716
|
"Theme",
|
|
650
717
|
"Documentation",
|
|
@@ -659,7 +726,7 @@ var DesignElementType = DesignTokenType.or(
|
|
|
659
726
|
function isTokenType(type) {
|
|
660
727
|
return DesignTokenType.safeParse(type).success;
|
|
661
728
|
}
|
|
662
|
-
var DesignElementCategory =
|
|
729
|
+
var DesignElementCategory = z37.enum([
|
|
663
730
|
"Token",
|
|
664
731
|
"Component",
|
|
665
732
|
"DesignSystemComponent",
|
|
@@ -667,103 +734,36 @@ var DesignElementCategory = z33.enum([
|
|
|
667
734
|
"Theme",
|
|
668
735
|
"PageBlock"
|
|
669
736
|
]);
|
|
670
|
-
var DesignSystemElementExportProps =
|
|
671
|
-
isAsset:
|
|
672
|
-
codeName:
|
|
673
|
-
});
|
|
674
|
-
var ShallowDesignElement =
|
|
675
|
-
id:
|
|
676
|
-
persistentId:
|
|
677
|
-
designSystemVersionId:
|
|
737
|
+
var DesignSystemElementExportProps = z37.object({
|
|
738
|
+
isAsset: z37.boolean().nullish().transform((v) => v ?? false),
|
|
739
|
+
codeName: z37.string().nullish()
|
|
740
|
+
});
|
|
741
|
+
var ShallowDesignElement = z37.object({
|
|
742
|
+
id: z37.string(),
|
|
743
|
+
persistentId: z37.string(),
|
|
744
|
+
designSystemVersionId: z37.string(),
|
|
678
745
|
type: DesignElementType,
|
|
679
|
-
brandPersistentId:
|
|
680
|
-
parentPersistentId:
|
|
681
|
-
shortPersistentId:
|
|
746
|
+
brandPersistentId: z37.string().optional(),
|
|
747
|
+
parentPersistentId: z37.string().optional(),
|
|
748
|
+
shortPersistentId: z37.string().optional(),
|
|
682
749
|
childType: DesignElementType.optional(),
|
|
683
|
-
sortOrder:
|
|
684
|
-
origin:
|
|
685
|
-
createdAt:
|
|
686
|
-
updatedAt:
|
|
750
|
+
sortOrder: z37.number(),
|
|
751
|
+
origin: z37.record(z37.any()).optional(),
|
|
752
|
+
createdAt: z37.coerce.date(),
|
|
753
|
+
updatedAt: z37.coerce.date()
|
|
687
754
|
});
|
|
688
755
|
var DesignElement = ShallowDesignElement.extend({
|
|
689
756
|
meta: ObjectMeta,
|
|
690
|
-
slug:
|
|
691
|
-
userSlug:
|
|
757
|
+
slug: z37.string().optional(),
|
|
758
|
+
userSlug: z37.string().optional(),
|
|
692
759
|
exportProperties: DesignSystemElementExportProps.optional(),
|
|
693
|
-
data:
|
|
694
|
-
origin:
|
|
760
|
+
data: z37.record(z37.any()),
|
|
761
|
+
origin: z37.record(z37.any()).optional()
|
|
695
762
|
});
|
|
696
763
|
var HierarchicalElements = DesignTokenType.or(
|
|
697
|
-
|
|
764
|
+
z37.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
|
|
698
765
|
);
|
|
699
766
|
|
|
700
|
-
// src/dsm/properties/property-definition.ts
|
|
701
|
-
import { z as z34 } from "zod";
|
|
702
|
-
var ElementPropertyTypeSchema = z34.enum(["Text", "Number", "Boolean", "Select", "Generic", "Link", "URL"]);
|
|
703
|
-
var ElementPropertyTargetType = z34.enum(["Token", "Component", "DocumentationPage"]);
|
|
704
|
-
var ElementPropertyLinkType = z34.enum(["FigmaComponent", "DocumentationPage"]);
|
|
705
|
-
var CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
|
|
706
|
-
var ColorTokenInlineData = z34.object({
|
|
707
|
-
value: z34.string()
|
|
708
|
-
});
|
|
709
|
-
var ElementPropertyDefinitionOption = z34.object({
|
|
710
|
-
id: z34.string(),
|
|
711
|
-
name: z34.string(),
|
|
712
|
-
backgroundColor: ColorTokenInlineData.optional()
|
|
713
|
-
});
|
|
714
|
-
var ElementPropertyDefinition = z34.object({
|
|
715
|
-
id: z34.string(),
|
|
716
|
-
designSystemVersionId: z34.string(),
|
|
717
|
-
persistentId: z34.string(),
|
|
718
|
-
name: z34.string(),
|
|
719
|
-
codeName: z34.string().regex(CODE_NAME_REGEX),
|
|
720
|
-
description: z34.string(),
|
|
721
|
-
type: ElementPropertyTypeSchema,
|
|
722
|
-
targetElementType: ElementPropertyTargetType,
|
|
723
|
-
options: z34.array(ElementPropertyDefinitionOption).optional(),
|
|
724
|
-
linkElementType: ElementPropertyLinkType.optional()
|
|
725
|
-
});
|
|
726
|
-
var ElementPropertyType = ElementPropertyTypeSchema.enum;
|
|
727
|
-
|
|
728
|
-
// src/dsm/properties/property-value.ts
|
|
729
|
-
import { z as z35 } from "zod";
|
|
730
|
-
var ElementPropertyValue = z35.object({
|
|
731
|
-
id: z35.string(),
|
|
732
|
-
designSystemVersionId: z35.string(),
|
|
733
|
-
targetElementPersistentId: z35.string(),
|
|
734
|
-
definitionPersistentId: z35.string(),
|
|
735
|
-
stringValue: z35.string().nullish(),
|
|
736
|
-
numberValue: z35.number().nullish(),
|
|
737
|
-
booleanValue: z35.boolean().nullish(),
|
|
738
|
-
referenceValue: z35.string().nullish(),
|
|
739
|
-
referenceValuePreview: z35.string().optional()
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
// src/dsm/elements/primitives/point.ts
|
|
743
|
-
import { z as z36 } from "zod";
|
|
744
|
-
var Point2D = z36.object({
|
|
745
|
-
x: z36.number(),
|
|
746
|
-
y: z36.number()
|
|
747
|
-
});
|
|
748
|
-
|
|
749
|
-
// src/dsm/elements/primitives/size.ts
|
|
750
|
-
import { z as z37 } from "zod";
|
|
751
|
-
var nullSize = { height: -1, width: -1 };
|
|
752
|
-
function isNullSize(size) {
|
|
753
|
-
return size.height === nullSize.height && size.width === nullSize.width;
|
|
754
|
-
}
|
|
755
|
-
var Size = z37.object({
|
|
756
|
-
width: z37.number().nullish().transform((v) => v ?? nullSize.width),
|
|
757
|
-
height: z37.number().nullish().transform((v) => v ?? nullSize.height)
|
|
758
|
-
});
|
|
759
|
-
var SizeOrUndefined = Size.optional().transform((v) => {
|
|
760
|
-
if (!v)
|
|
761
|
-
return void 0;
|
|
762
|
-
if (isNullSize(v))
|
|
763
|
-
return void 0;
|
|
764
|
-
return v;
|
|
765
|
-
});
|
|
766
|
-
|
|
767
767
|
// src/dsm/elements/data/documentation-block-v1.ts
|
|
768
768
|
var PageBlockCalloutType = z38.enum(["Info", "Primary", "Success", "Warning", "Error"]);
|
|
769
769
|
var PageBlockTypeV1 = z38.enum([
|
|
@@ -797,7 +797,8 @@ var PageBlockTypeV1 = z38.enum([
|
|
|
797
797
|
"TabItem",
|
|
798
798
|
"Table",
|
|
799
799
|
"TableRow",
|
|
800
|
-
"TableCell"
|
|
800
|
+
"TableCell",
|
|
801
|
+
"Guidelines"
|
|
801
802
|
]);
|
|
802
803
|
var PageBlockCodeLanguage = z38.enum([
|
|
803
804
|
"Angular",
|
|
@@ -955,9 +956,15 @@ var PageBlockTextSpan = z38.object({
|
|
|
955
956
|
var PageBlockText = z38.object({
|
|
956
957
|
spans: z38.array(PageBlockTextSpan)
|
|
957
958
|
});
|
|
959
|
+
var PageBlockGuideline = z38.object({
|
|
960
|
+
description: nullishToOptional(z38.string()),
|
|
961
|
+
asset: nullishToOptional(PageBlockAsset),
|
|
962
|
+
type: z38.string()
|
|
963
|
+
});
|
|
958
964
|
var PageBlockBaseV1 = z38.object({
|
|
959
965
|
persistentId: z38.string(),
|
|
960
966
|
type: PageBlockTypeV1,
|
|
967
|
+
numberOfColumns: nullishToOptional(z38.number()),
|
|
961
968
|
// Element linking
|
|
962
969
|
designObjectId: nullishToOptional(z38.string()),
|
|
963
970
|
designObjectIds: nullishToOptional(z38.array(z38.string())),
|
|
@@ -978,6 +985,8 @@ var PageBlockBaseV1 = z38.object({
|
|
|
978
985
|
alignment: nullishToOptional(PageBlockAlignment),
|
|
979
986
|
// Shortcuts block
|
|
980
987
|
shortcuts: nullishToOptional(z38.array(PageBlockShortcut)),
|
|
988
|
+
// Guidelines
|
|
989
|
+
guidelines: nullishToOptional(PageBlockGuideline.array()),
|
|
981
990
|
// Custom blocks
|
|
982
991
|
customBlockKey: nullishToOptional(z38.string()),
|
|
983
992
|
customBlockProperties: nullishToOptional(z38.array(PageBlockCustomBlockPropertyValue)),
|
|
@@ -2710,7 +2719,8 @@ var PageBlockDefinition = z97.object({
|
|
|
2710
2719
|
item: PageBlockDefinitionItem,
|
|
2711
2720
|
behavior: PageBlockDefinitionBehavior,
|
|
2712
2721
|
editorOptions: z97.object({
|
|
2713
|
-
onboarding: PageBlockDefinitionOnboarding.optional()
|
|
2722
|
+
onboarding: PageBlockDefinitionOnboarding.optional(),
|
|
2723
|
+
newItemLabel: z97.string().optional()
|
|
2714
2724
|
}),
|
|
2715
2725
|
appearance: PageBlockDefinitionAppearance.optional()
|
|
2716
2726
|
});
|
|
@@ -2826,6 +2836,7 @@ import { z as z105 } from "zod";
|
|
|
2826
2836
|
var DesignElementSnapshotReason = z105.enum(["Publish", "Deletion"]);
|
|
2827
2837
|
var DesignElementSnapshotBase = z105.object({
|
|
2828
2838
|
id: z105.string(),
|
|
2839
|
+
persistentId: z105.string(),
|
|
2829
2840
|
designSystemVersionId: z105.string(),
|
|
2830
2841
|
createdAt: z105.coerce.date(),
|
|
2831
2842
|
updatedAt: z105.coerce.date(),
|
|
@@ -3282,12 +3293,12 @@ var DesignSystemVersionRoomInitialState = z123.object({
|
|
|
3282
3293
|
var DesignSystemVersionRoomUpdate = z123.object({
|
|
3283
3294
|
pages: z123.array(DocumentationPageV2),
|
|
3284
3295
|
groups: z123.array(ElementGroup),
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3296
|
+
pageIdsToDelete: z123.array(z123.string()),
|
|
3297
|
+
groupIdsToDelete: z123.array(z123.string()),
|
|
3298
|
+
pageSnapshots: z123.array(DocumentationPageSnapshot),
|
|
3299
|
+
groupSnapshots: z123.array(ElementGroupSnapshot),
|
|
3300
|
+
pageSnapshotIdsToDelete: z123.array(z123.string()),
|
|
3301
|
+
groupSnapshotIdsToDelete: z123.array(z123.string())
|
|
3291
3302
|
});
|
|
3292
3303
|
|
|
3293
3304
|
// src/liveblocks/rooms/documentation-page-room.ts
|
|
@@ -5237,6 +5248,7 @@ export {
|
|
|
5237
5248
|
PageBlockFigmaNodeEntityMeta,
|
|
5238
5249
|
PageBlockFrame,
|
|
5239
5250
|
PageBlockFrameOrigin,
|
|
5251
|
+
PageBlockGuideline,
|
|
5240
5252
|
PageBlockImageAlignment,
|
|
5241
5253
|
PageBlockImageReference,
|
|
5242
5254
|
PageBlockImageResourceReference,
|