@supernova-studio/client 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +87 -100
- package/dist/index.d.ts +87 -100
- package/dist/index.js +752 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +746 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/docs-editor/blocks-to-prosemirror.ts +88 -114
- package/src/docs-editor/mock.ts +2 -2
- package/src/docs-editor/prosemirror/types.ts +3 -7
- package/src/docs-editor/prosemirror-to-blocks.ts +226 -3
- package/src/docs-editor/utils.ts +14 -0
- package/src/index.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _supernova_studio_model from '@supernova-studio/model';
|
|
2
|
-
import {
|
|
2
|
+
import { PageBlockItemUntypedPropertyValue, PageBlockDefinition, PageBlockItemV2, PageBlockItemRichTextPropertyValue, PageBlockItemMultiRichTextPropertyValue, PageBlockItemEmbedPropertyValue, PageBlockDefinitionPropertyType } from '@supernova-studio/model';
|
|
3
|
+
export * from '@supernova-studio/model';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { Schema } from 'prosemirror-model';
|
|
5
6
|
import * as Y from 'yjs';
|
|
@@ -17,7 +18,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
17
18
|
properties: z.ZodArray<z.ZodObject<{
|
|
18
19
|
id: z.ZodString;
|
|
19
20
|
name: z.ZodString;
|
|
20
|
-
type: z.ZodEnum<["RichText", "MultiRichText", "Text", "Boolean", "Number", "SingleSelect", "MultiSelect", "Image", "Token", "TokenType", "TokenProperty", "Component", "ComponentProperty", "Asset", "AssetProperty", "EmbedURL", "URL", "Markdown", "Code", "CodeSandbox", "Table", "Divider", "Storybook"]>;
|
|
21
|
+
type: z.ZodEnum<["RichText", "MultiRichText", "Text", "Boolean", "Number", "SingleSelect", "MultiSelect", "Image", "Token", "TokenType", "TokenProperty", "Component", "ComponentProperty", "Asset", "AssetProperty", "EmbedURL", "URL", "Markdown", "Code", "CodeSandbox", "Table", "Divider", "Storybook", "Color"]>;
|
|
21
22
|
description: z.ZodOptional<z.ZodString>;
|
|
22
23
|
options: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
|
|
23
24
|
richTextStyle: z.ZodOptional<z.ZodEnum<["Title1", "Title2", "Title3", "Title4", "Title5", "Quote", "Callout", "Default"]>>;
|
|
@@ -53,7 +54,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
53
54
|
}>, z.ZodRecord<z.ZodString, z.ZodAny>>>>;
|
|
54
55
|
}, "strip", z.ZodTypeAny, {
|
|
55
56
|
id: string;
|
|
56
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
57
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
57
58
|
name: string;
|
|
58
59
|
description?: string | undefined;
|
|
59
60
|
options?: ({
|
|
@@ -70,7 +71,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
70
71
|
} & Record<string, any>> | undefined;
|
|
71
72
|
}, {
|
|
72
73
|
id: string;
|
|
73
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
74
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
74
75
|
name: string;
|
|
75
76
|
description?: string | undefined;
|
|
76
77
|
options?: ({
|
|
@@ -168,7 +169,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
168
169
|
}, "strip", z.ZodTypeAny, {
|
|
169
170
|
properties: {
|
|
170
171
|
id: string;
|
|
171
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
172
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
172
173
|
name: string;
|
|
173
174
|
description?: string | undefined;
|
|
174
175
|
options?: ({
|
|
@@ -215,7 +216,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
215
216
|
}, {
|
|
216
217
|
properties: {
|
|
217
218
|
id: string;
|
|
218
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
219
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
219
220
|
name: string;
|
|
220
221
|
description?: string | undefined;
|
|
221
222
|
options?: ({
|
|
@@ -283,7 +284,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
283
284
|
maxSelected: number;
|
|
284
285
|
}>>;
|
|
285
286
|
}, "strip", z.ZodTypeAny, {
|
|
286
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
287
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
287
288
|
items?: {
|
|
288
289
|
numberOfItems: number;
|
|
289
290
|
allowLinks: boolean;
|
|
@@ -293,7 +294,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
293
294
|
maxSelected: number;
|
|
294
295
|
} | undefined;
|
|
295
296
|
}, {
|
|
296
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
297
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
297
298
|
items?: {
|
|
298
299
|
numberOfItems: number;
|
|
299
300
|
allowLinks: boolean;
|
|
@@ -343,7 +344,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
343
344
|
name: string;
|
|
344
345
|
description: string;
|
|
345
346
|
behavior: {
|
|
346
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
347
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
347
348
|
items?: {
|
|
348
349
|
numberOfItems: number;
|
|
349
350
|
allowLinks: boolean;
|
|
@@ -357,7 +358,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
357
358
|
item: {
|
|
358
359
|
properties: {
|
|
359
360
|
id: string;
|
|
360
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
361
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
361
362
|
name: string;
|
|
362
363
|
description?: string | undefined;
|
|
363
364
|
options?: ({
|
|
@@ -421,7 +422,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
421
422
|
name: string;
|
|
422
423
|
description: string;
|
|
423
424
|
behavior: {
|
|
424
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
425
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
425
426
|
items?: {
|
|
426
427
|
numberOfItems: number;
|
|
427
428
|
allowLinks: boolean;
|
|
@@ -435,7 +436,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
435
436
|
item: {
|
|
436
437
|
properties: {
|
|
437
438
|
id: string;
|
|
438
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
439
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
439
440
|
name: string;
|
|
440
441
|
description?: string | undefined;
|
|
441
442
|
options?: ({
|
|
@@ -501,7 +502,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
501
502
|
name: string;
|
|
502
503
|
description: string;
|
|
503
504
|
behavior: {
|
|
504
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
505
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
505
506
|
items?: {
|
|
506
507
|
numberOfItems: number;
|
|
507
508
|
allowLinks: boolean;
|
|
@@ -515,7 +516,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
515
516
|
item: {
|
|
516
517
|
properties: {
|
|
517
518
|
id: string;
|
|
518
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
519
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
519
520
|
name: string;
|
|
520
521
|
description?: string | undefined;
|
|
521
522
|
options?: ({
|
|
@@ -581,7 +582,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
581
582
|
name: string;
|
|
582
583
|
description: string;
|
|
583
584
|
behavior: {
|
|
584
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
585
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
585
586
|
items?: {
|
|
586
587
|
numberOfItems: number;
|
|
587
588
|
allowLinks: boolean;
|
|
@@ -595,7 +596,7 @@ declare const GetBlockDefinitionsResponse: z.ZodObject<{
|
|
|
595
596
|
item: {
|
|
596
597
|
properties: {
|
|
597
598
|
id: string;
|
|
598
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
599
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
599
600
|
name: string;
|
|
600
601
|
description?: string | undefined;
|
|
601
602
|
options?: ({
|
|
@@ -765,24 +766,21 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
765
766
|
items: z.ZodArray<z.ZodObject<{
|
|
766
767
|
id: z.ZodString;
|
|
767
768
|
linksTo: z.ZodOptional<z.ZodObject<{
|
|
768
|
-
type: z.ZodEnum<["
|
|
769
|
-
|
|
769
|
+
type: z.ZodEnum<["DocumentationItem", "PageHeading", "Url"]>;
|
|
770
|
+
documentationItemId: z.ZodOptional<z.ZodString>;
|
|
770
771
|
pageHeadingId: z.ZodOptional<z.ZodString>;
|
|
771
|
-
groupId: z.ZodOptional<z.ZodString>;
|
|
772
772
|
url: z.ZodOptional<z.ZodString>;
|
|
773
773
|
openInNewTab: z.ZodOptional<z.ZodBoolean>;
|
|
774
774
|
}, "strip", z.ZodTypeAny, {
|
|
775
|
-
type: "
|
|
776
|
-
|
|
775
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
776
|
+
documentationItemId?: string | undefined;
|
|
777
777
|
pageHeadingId?: string | undefined;
|
|
778
|
-
groupId?: string | undefined;
|
|
779
778
|
url?: string | undefined;
|
|
780
779
|
openInNewTab?: boolean | undefined;
|
|
781
780
|
}, {
|
|
782
|
-
type: "
|
|
783
|
-
|
|
781
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
782
|
+
documentationItemId?: string | undefined;
|
|
784
783
|
pageHeadingId?: string | undefined;
|
|
785
|
-
groupId?: string | undefined;
|
|
786
784
|
url?: string | undefined;
|
|
787
785
|
openInNewTab?: boolean | undefined;
|
|
788
786
|
}>>;
|
|
@@ -799,10 +797,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
799
797
|
value?: any;
|
|
800
798
|
} & Record<string, any>>;
|
|
801
799
|
linksTo?: {
|
|
802
|
-
type: "
|
|
803
|
-
|
|
800
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
801
|
+
documentationItemId?: string | undefined;
|
|
804
802
|
pageHeadingId?: string | undefined;
|
|
805
|
-
groupId?: string | undefined;
|
|
806
803
|
url?: string | undefined;
|
|
807
804
|
openInNewTab?: boolean | undefined;
|
|
808
805
|
} | undefined;
|
|
@@ -812,10 +809,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
812
809
|
value?: any;
|
|
813
810
|
} & Record<string, any>>;
|
|
814
811
|
linksTo?: {
|
|
815
|
-
type: "
|
|
816
|
-
|
|
812
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
813
|
+
documentationItemId?: string | undefined;
|
|
817
814
|
pageHeadingId?: string | undefined;
|
|
818
|
-
groupId?: string | undefined;
|
|
819
815
|
url?: string | undefined;
|
|
820
816
|
openInNewTab?: boolean | undefined;
|
|
821
817
|
} | undefined;
|
|
@@ -829,10 +825,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
829
825
|
value?: any;
|
|
830
826
|
} & Record<string, any>>;
|
|
831
827
|
linksTo?: {
|
|
832
|
-
type: "
|
|
833
|
-
|
|
828
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
829
|
+
documentationItemId?: string | undefined;
|
|
834
830
|
pageHeadingId?: string | undefined;
|
|
835
|
-
groupId?: string | undefined;
|
|
836
831
|
url?: string | undefined;
|
|
837
832
|
openInNewTab?: boolean | undefined;
|
|
838
833
|
} | undefined;
|
|
@@ -863,10 +858,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
863
858
|
value?: any;
|
|
864
859
|
} & Record<string, any>>;
|
|
865
860
|
linksTo?: {
|
|
866
|
-
type: "
|
|
867
|
-
|
|
861
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
862
|
+
documentationItemId?: string | undefined;
|
|
868
863
|
pageHeadingId?: string | undefined;
|
|
869
|
-
groupId?: string | undefined;
|
|
870
864
|
url?: string | undefined;
|
|
871
865
|
openInNewTab?: boolean | undefined;
|
|
872
866
|
} | undefined;
|
|
@@ -900,10 +894,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
900
894
|
value?: any;
|
|
901
895
|
} & Record<string, any>>;
|
|
902
896
|
linksTo?: {
|
|
903
|
-
type: "
|
|
904
|
-
|
|
897
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
898
|
+
documentationItemId?: string | undefined;
|
|
905
899
|
pageHeadingId?: string | undefined;
|
|
906
|
-
groupId?: string | undefined;
|
|
907
900
|
url?: string | undefined;
|
|
908
901
|
openInNewTab?: boolean | undefined;
|
|
909
902
|
} | undefined;
|
|
@@ -937,10 +930,9 @@ declare const PageBlockEditorModel: z.ZodObject<{
|
|
|
937
930
|
value?: any;
|
|
938
931
|
} & Record<string, any>>;
|
|
939
932
|
linksTo?: {
|
|
940
|
-
type: "
|
|
941
|
-
|
|
933
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
934
|
+
documentationItemId?: string | undefined;
|
|
942
935
|
pageHeadingId?: string | undefined;
|
|
943
|
-
groupId?: string | undefined;
|
|
944
936
|
url?: string | undefined;
|
|
945
937
|
openInNewTab?: boolean | undefined;
|
|
946
938
|
} | undefined;
|
|
@@ -1074,24 +1066,21 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1074
1066
|
items: z.ZodArray<z.ZodObject<{
|
|
1075
1067
|
id: z.ZodString;
|
|
1076
1068
|
linksTo: z.ZodOptional<z.ZodObject<{
|
|
1077
|
-
type: z.ZodEnum<["
|
|
1078
|
-
|
|
1069
|
+
type: z.ZodEnum<["DocumentationItem", "PageHeading", "Url"]>;
|
|
1070
|
+
documentationItemId: z.ZodOptional<z.ZodString>;
|
|
1079
1071
|
pageHeadingId: z.ZodOptional<z.ZodString>;
|
|
1080
|
-
groupId: z.ZodOptional<z.ZodString>;
|
|
1081
1072
|
url: z.ZodOptional<z.ZodString>;
|
|
1082
1073
|
openInNewTab: z.ZodOptional<z.ZodBoolean>;
|
|
1083
1074
|
}, "strip", z.ZodTypeAny, {
|
|
1084
|
-
type: "
|
|
1085
|
-
|
|
1075
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1076
|
+
documentationItemId?: string | undefined;
|
|
1086
1077
|
pageHeadingId?: string | undefined;
|
|
1087
|
-
groupId?: string | undefined;
|
|
1088
1078
|
url?: string | undefined;
|
|
1089
1079
|
openInNewTab?: boolean | undefined;
|
|
1090
1080
|
}, {
|
|
1091
|
-
type: "
|
|
1092
|
-
|
|
1081
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1082
|
+
documentationItemId?: string | undefined;
|
|
1093
1083
|
pageHeadingId?: string | undefined;
|
|
1094
|
-
groupId?: string | undefined;
|
|
1095
1084
|
url?: string | undefined;
|
|
1096
1085
|
openInNewTab?: boolean | undefined;
|
|
1097
1086
|
}>>;
|
|
@@ -1108,10 +1097,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1108
1097
|
value?: any;
|
|
1109
1098
|
} & Record<string, any>>;
|
|
1110
1099
|
linksTo?: {
|
|
1111
|
-
type: "
|
|
1112
|
-
|
|
1100
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1101
|
+
documentationItemId?: string | undefined;
|
|
1113
1102
|
pageHeadingId?: string | undefined;
|
|
1114
|
-
groupId?: string | undefined;
|
|
1115
1103
|
url?: string | undefined;
|
|
1116
1104
|
openInNewTab?: boolean | undefined;
|
|
1117
1105
|
} | undefined;
|
|
@@ -1121,10 +1109,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1121
1109
|
value?: any;
|
|
1122
1110
|
} & Record<string, any>>;
|
|
1123
1111
|
linksTo?: {
|
|
1124
|
-
type: "
|
|
1125
|
-
|
|
1112
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1113
|
+
documentationItemId?: string | undefined;
|
|
1126
1114
|
pageHeadingId?: string | undefined;
|
|
1127
|
-
groupId?: string | undefined;
|
|
1128
1115
|
url?: string | undefined;
|
|
1129
1116
|
openInNewTab?: boolean | undefined;
|
|
1130
1117
|
} | undefined;
|
|
@@ -1138,10 +1125,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1138
1125
|
value?: any;
|
|
1139
1126
|
} & Record<string, any>>;
|
|
1140
1127
|
linksTo?: {
|
|
1141
|
-
type: "
|
|
1142
|
-
|
|
1128
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1129
|
+
documentationItemId?: string | undefined;
|
|
1143
1130
|
pageHeadingId?: string | undefined;
|
|
1144
|
-
groupId?: string | undefined;
|
|
1145
1131
|
url?: string | undefined;
|
|
1146
1132
|
openInNewTab?: boolean | undefined;
|
|
1147
1133
|
} | undefined;
|
|
@@ -1172,10 +1158,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1172
1158
|
value?: any;
|
|
1173
1159
|
} & Record<string, any>>;
|
|
1174
1160
|
linksTo?: {
|
|
1175
|
-
type: "
|
|
1176
|
-
|
|
1161
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1162
|
+
documentationItemId?: string | undefined;
|
|
1177
1163
|
pageHeadingId?: string | undefined;
|
|
1178
|
-
groupId?: string | undefined;
|
|
1179
1164
|
url?: string | undefined;
|
|
1180
1165
|
openInNewTab?: boolean | undefined;
|
|
1181
1166
|
} | undefined;
|
|
@@ -1209,10 +1194,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1209
1194
|
value?: any;
|
|
1210
1195
|
} & Record<string, any>>;
|
|
1211
1196
|
linksTo?: {
|
|
1212
|
-
type: "
|
|
1213
|
-
|
|
1197
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1198
|
+
documentationItemId?: string | undefined;
|
|
1214
1199
|
pageHeadingId?: string | undefined;
|
|
1215
|
-
groupId?: string | undefined;
|
|
1216
1200
|
url?: string | undefined;
|
|
1217
1201
|
openInNewTab?: boolean | undefined;
|
|
1218
1202
|
} | undefined;
|
|
@@ -1246,10 +1230,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1246
1230
|
value?: any;
|
|
1247
1231
|
} & Record<string, any>>;
|
|
1248
1232
|
linksTo?: {
|
|
1249
|
-
type: "
|
|
1250
|
-
|
|
1233
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1234
|
+
documentationItemId?: string | undefined;
|
|
1251
1235
|
pageHeadingId?: string | undefined;
|
|
1252
|
-
groupId?: string | undefined;
|
|
1253
1236
|
url?: string | undefined;
|
|
1254
1237
|
openInNewTab?: boolean | undefined;
|
|
1255
1238
|
} | undefined;
|
|
@@ -1285,10 +1268,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1285
1268
|
value?: any;
|
|
1286
1269
|
} & Record<string, any>>;
|
|
1287
1270
|
linksTo?: {
|
|
1288
|
-
type: "
|
|
1289
|
-
|
|
1271
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1272
|
+
documentationItemId?: string | undefined;
|
|
1290
1273
|
pageHeadingId?: string | undefined;
|
|
1291
|
-
groupId?: string | undefined;
|
|
1292
1274
|
url?: string | undefined;
|
|
1293
1275
|
openInNewTab?: boolean | undefined;
|
|
1294
1276
|
} | undefined;
|
|
@@ -1324,10 +1306,9 @@ declare const DocumentationPageEditorModel: z.ZodObject<{
|
|
|
1324
1306
|
value?: any;
|
|
1325
1307
|
} & Record<string, any>>;
|
|
1326
1308
|
linksTo?: {
|
|
1327
|
-
type: "
|
|
1328
|
-
|
|
1309
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1310
|
+
documentationItemId?: string | undefined;
|
|
1329
1311
|
pageHeadingId?: string | undefined;
|
|
1330
|
-
groupId?: string | undefined;
|
|
1331
1312
|
url?: string | undefined;
|
|
1332
1313
|
openInNewTab?: boolean | undefined;
|
|
1333
1314
|
} | undefined;
|
|
@@ -1368,20 +1349,10 @@ type ProsemirrorMark = {
|
|
|
1368
1349
|
attrs: Record<string, any>;
|
|
1369
1350
|
};
|
|
1370
1351
|
type ProsemirrorBlockItem = {
|
|
1371
|
-
properties: ProsemirrorBlockItemPropertyValue[];
|
|
1372
|
-
};
|
|
1373
|
-
type ProsemirrorBlockItemPropertyValue = {
|
|
1374
1352
|
id: string;
|
|
1375
|
-
|
|
1376
|
-
value?: string;
|
|
1377
|
-
};
|
|
1353
|
+
props: Record<string, PageBlockItemUntypedPropertyValue>;
|
|
1378
1354
|
};
|
|
1379
1355
|
|
|
1380
|
-
type Input = {
|
|
1381
|
-
block: PageBlockEditorModel;
|
|
1382
|
-
definition: PageBlockDefinition;
|
|
1383
|
-
property: PageBlockDefinitionProperty;
|
|
1384
|
-
};
|
|
1385
1356
|
declare function pageToYXmlFragment(page: DocumentationPageEditorModel, definitions: PageBlockDefinition[], fragment: Y.XmlFragment): Y.XmlFragment;
|
|
1386
1357
|
declare function pageToProsemirrorDoc(page: DocumentationPageEditorModel, definitions: PageBlockDefinition[]): ProsemirrorNode;
|
|
1387
1358
|
declare function blockDefinitionForBlock(block: PageBlockEditorModel, definitions: PageBlockDefinition[]): {
|
|
@@ -1389,7 +1360,7 @@ declare function blockDefinitionForBlock(block: PageBlockEditorModel, definition
|
|
|
1389
1360
|
name: string;
|
|
1390
1361
|
description: string;
|
|
1391
1362
|
behavior: {
|
|
1392
|
-
dataType: "Component" | "Token" | "Asset" | "
|
|
1363
|
+
dataType: "Component" | "Token" | "Asset" | "FigmaFrame" | "Item";
|
|
1393
1364
|
items?: {
|
|
1394
1365
|
numberOfItems: number;
|
|
1395
1366
|
allowLinks: boolean;
|
|
@@ -1403,7 +1374,7 @@ declare function blockDefinitionForBlock(block: PageBlockEditorModel, definition
|
|
|
1403
1374
|
item: {
|
|
1404
1375
|
properties: {
|
|
1405
1376
|
id: string;
|
|
1406
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1377
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1407
1378
|
name: string;
|
|
1408
1379
|
description?: string | undefined;
|
|
1409
1380
|
options?: ({
|
|
@@ -1464,8 +1435,6 @@ declare function blockDefinitionForBlock(block: PageBlockEditorModel, definition
|
|
|
1464
1435
|
} | undefined;
|
|
1465
1436
|
};
|
|
1466
1437
|
declare function blockToProsemirrorNode(block: PageBlockEditorModel, definition: PageBlockDefinition): ProsemirrorNode | null;
|
|
1467
|
-
declare function serializeAsRichTextBlock(input: Input): ProsemirrorNode;
|
|
1468
|
-
declare function serializeAsMultiRichTextBlock(input: Input): ProsemirrorNode;
|
|
1469
1438
|
declare function serializeAsCustomBlock(block: PageBlockEditorModel, definition: PageBlockDefinition): ProsemirrorNode;
|
|
1470
1439
|
|
|
1471
1440
|
declare function getMockPageBlockDefinitions(): PageBlockDefinition[];
|
|
@@ -1481,16 +1450,16 @@ declare const BlockParsingUtils: {
|
|
|
1481
1450
|
value?: any;
|
|
1482
1451
|
} & Record<string, any>>;
|
|
1483
1452
|
linksTo?: {
|
|
1484
|
-
type: "
|
|
1485
|
-
|
|
1453
|
+
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
1454
|
+
documentationItemId?: string | undefined;
|
|
1486
1455
|
pageHeadingId?: string | undefined;
|
|
1487
|
-
groupId?: string | undefined;
|
|
1488
1456
|
url?: string | undefined;
|
|
1489
1457
|
openInNewTab?: boolean | undefined;
|
|
1490
1458
|
} | undefined;
|
|
1491
1459
|
};
|
|
1492
1460
|
richTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemRichTextPropertyValue;
|
|
1493
1461
|
multiRichTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemMultiRichTextPropertyValue;
|
|
1462
|
+
embedPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemEmbedPropertyValue;
|
|
1494
1463
|
objectPropertyValue(item: PageBlockItemV2, propertyKey: string): {
|
|
1495
1464
|
value?: any;
|
|
1496
1465
|
} & Record<string, any>;
|
|
@@ -1499,7 +1468,7 @@ declare const BlockParsingUtils: {
|
|
|
1499
1468
|
declare const BlockDefinitionUtils: {
|
|
1500
1469
|
firstRichTextProperty(definition: PageBlockDefinition): {
|
|
1501
1470
|
id: string;
|
|
1502
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1471
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1503
1472
|
name: string;
|
|
1504
1473
|
description?: string | undefined;
|
|
1505
1474
|
options?: ({
|
|
@@ -1517,7 +1486,7 @@ declare const BlockDefinitionUtils: {
|
|
|
1517
1486
|
} | undefined;
|
|
1518
1487
|
firstMultiRichTextProperty(definition: PageBlockDefinition): {
|
|
1519
1488
|
id: string;
|
|
1520
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1489
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1521
1490
|
name: string;
|
|
1522
1491
|
description?: string | undefined;
|
|
1523
1492
|
options?: ({
|
|
@@ -1535,7 +1504,25 @@ declare const BlockDefinitionUtils: {
|
|
|
1535
1504
|
} | undefined;
|
|
1536
1505
|
firstTableProperty(definition: PageBlockDefinition): {
|
|
1537
1506
|
id: string;
|
|
1538
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1507
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1508
|
+
name: string;
|
|
1509
|
+
description?: string | undefined;
|
|
1510
|
+
options?: ({
|
|
1511
|
+
richTextStyle?: "Quote" | "Callout" | "Title1" | "Title2" | "Title3" | "Title4" | "Title5" | "Default" | undefined;
|
|
1512
|
+
multiRichTextStyle?: "Default" | "OL" | "UL" | undefined;
|
|
1513
|
+
textStyle?: "Small" | "Title1" | "Title2" | "Title3" | "Title4" | "Title5" | "Default" | "DefaultBold" | "DefaultSemibold" | "SmallBold" | "SmallSemibold" | undefined;
|
|
1514
|
+
placeholder?: string | undefined;
|
|
1515
|
+
} & Record<string, any>) | undefined;
|
|
1516
|
+
variantOptions?: Record<string, {
|
|
1517
|
+
richTextStyle?: "Quote" | "Callout" | "Title1" | "Title2" | "Title3" | "Title4" | "Title5" | "Default" | undefined;
|
|
1518
|
+
multiRichTextStyle?: "Default" | "OL" | "UL" | undefined;
|
|
1519
|
+
textStyle?: "Small" | "Title1" | "Title2" | "Title3" | "Title4" | "Title5" | "Default" | "DefaultBold" | "DefaultSemibold" | "SmallBold" | "SmallSemibold" | undefined;
|
|
1520
|
+
placeholder?: string | undefined;
|
|
1521
|
+
} & Record<string, any>> | undefined;
|
|
1522
|
+
} | undefined;
|
|
1523
|
+
firstEmbedProperty(definition: PageBlockDefinition): {
|
|
1524
|
+
id: string;
|
|
1525
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1539
1526
|
name: string;
|
|
1540
1527
|
description?: string | undefined;
|
|
1541
1528
|
options?: ({
|
|
@@ -1553,7 +1540,7 @@ declare const BlockDefinitionUtils: {
|
|
|
1553
1540
|
} | undefined;
|
|
1554
1541
|
richTextProperty(definition: PageBlockDefinition, propertyKey: string): {
|
|
1555
1542
|
id: string;
|
|
1556
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1543
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1557
1544
|
name: string;
|
|
1558
1545
|
description?: string | undefined;
|
|
1559
1546
|
options?: ({
|
|
@@ -1571,7 +1558,7 @@ declare const BlockDefinitionUtils: {
|
|
|
1571
1558
|
};
|
|
1572
1559
|
property(definition: PageBlockDefinition, propertyKey: string, expectedPropertyType?: PageBlockDefinitionPropertyType): {
|
|
1573
1560
|
id: string;
|
|
1574
|
-
type: "Image" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "
|
|
1561
|
+
type: "Image" | "Color" | "Component" | "Token" | "Text" | "Number" | "Boolean" | "URL" | "Code" | "Divider" | "Table" | "Markdown" | "Asset" | "RichText" | "MultiRichText" | "SingleSelect" | "MultiSelect" | "TokenType" | "TokenProperty" | "ComponentProperty" | "AssetProperty" | "EmbedURL" | "CodeSandbox" | "Storybook";
|
|
1575
1562
|
name: string;
|
|
1576
1563
|
description?: string | undefined;
|
|
1577
1564
|
options?: ({
|
|
@@ -1589,4 +1576,4 @@ declare const BlockDefinitionUtils: {
|
|
|
1589
1576
|
};
|
|
1590
1577
|
};
|
|
1591
1578
|
|
|
1592
|
-
export { BlockDefinitionUtils, BlockParsingUtils, DocumentationPageEditorModel, GetBlockDefinitionsResponse, PageBlockEditorModel, type ProsemirrorBlockItem, type
|
|
1579
|
+
export { BlockDefinitionUtils, BlockParsingUtils, DocumentationPageEditorModel, GetBlockDefinitionsResponse, PageBlockEditorModel, type ProsemirrorBlockItem, type ProsemirrorMark, type ProsemirrorNode, blockDefinitionForBlock, blockToProsemirrorNode, getMockPageBlockDefinitions, pageToProsemirrorDoc, pageToYXmlFragment, pmSchema, prosemirrorDocToPage, prosemirrorNodeToBlock, serializeAsCustomBlock, yXmlFragmetToPage };
|