@fragmentsx/definition 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.
Files changed (78) hide show
  1. package/dist/constants/index.d.ts +23 -1
  2. package/dist/constants/index.d.ts.map +1 -1
  3. package/dist/helpers/getLayerSchema.d.ts.map +1 -1
  4. package/dist/helpers/transformTypes.d.ts +44 -0
  5. package/dist/helpers/transformTypes.d.ts.map +1 -0
  6. package/dist/index.cjs.js +187 -63
  7. package/dist/index.es.js +187 -63
  8. package/dist/schemas/InteractionsSchema.d.ts.map +1 -1
  9. package/dist/schemas/helperNodes/ArrayItemSchema.d.ts +8 -0
  10. package/dist/schemas/helperNodes/ArrayItemSchema.d.ts.map +1 -0
  11. package/dist/schemas/helperNodes/BorderSchema.d.ts +12 -0
  12. package/dist/schemas/helperNodes/BorderSchema.d.ts.map +1 -0
  13. package/dist/schemas/helperNodes/ClassnameSchema.d.ts +9 -0
  14. package/dist/schemas/helperNodes/ClassnameSchema.d.ts.map +1 -0
  15. package/dist/schemas/helperNodes/ComputedValueSchema.d.ts +12 -0
  16. package/dist/schemas/helperNodes/ComputedValueSchema.d.ts.map +1 -0
  17. package/dist/schemas/helperNodes/CssChunkSchema.d.ts +9 -0
  18. package/dist/schemas/helperNodes/CssChunkSchema.d.ts.map +1 -0
  19. package/dist/schemas/helperNodes/ImagePaintSchema.d.ts +11 -0
  20. package/dist/schemas/helperNodes/ImagePaintSchema.d.ts.map +1 -0
  21. package/dist/schemas/helperNodes/InteractionSchema.d.ts +9 -0
  22. package/dist/schemas/helperNodes/InteractionSchema.d.ts.map +1 -0
  23. package/dist/schemas/helperNodes/LinearGradientSchema.d.ts +11 -0
  24. package/dist/schemas/helperNodes/LinearGradientSchema.d.ts.map +1 -0
  25. package/dist/schemas/helperNodes/LinkSchema.d.ts +11 -0
  26. package/dist/schemas/helperNodes/LinkSchema.d.ts.map +1 -0
  27. package/dist/schemas/helperNodes/PaintSchema.d.ts +13 -0
  28. package/dist/schemas/helperNodes/PaintSchema.d.ts.map +1 -0
  29. package/dist/schemas/helperNodes/PaintsSchema.d.ts +11 -0
  30. package/dist/schemas/helperNodes/PaintsSchema.d.ts.map +1 -0
  31. package/dist/schemas/helperNodes/StopColorSchema.d.ts +11 -0
  32. package/dist/schemas/helperNodes/StopColorSchema.d.ts.map +1 -0
  33. package/dist/schemas/helperNodes/TextHighlightSchema.d.ts +11 -0
  34. package/dist/schemas/helperNodes/TextHighlightSchema.d.ts.map +1 -0
  35. package/dist/schemas/helperNodes/ValueTransformSchema.d.ts +11 -0
  36. package/dist/schemas/helperNodes/ValueTransformSchema.d.ts.map +1 -0
  37. package/dist/schemas/helperNodes/interactions/GoalEventSchema.d.ts +8 -0
  38. package/dist/schemas/helperNodes/interactions/GoalEventSchema.d.ts.map +1 -0
  39. package/dist/schemas/helperNodes/interactions/MutateEventSchema.d.ts +9 -0
  40. package/dist/schemas/helperNodes/interactions/MutateEventSchema.d.ts.map +1 -0
  41. package/dist/schemas/helperNodes/transforms/ComparisonTransformSchema.d.ts +49 -0
  42. package/dist/schemas/helperNodes/transforms/ComparisonTransformSchema.d.ts.map +1 -0
  43. package/dist/schemas/helperNodes/transforms/ConvertFromBooleanTransformSchema.d.ts +16 -0
  44. package/dist/schemas/helperNodes/transforms/ConvertFromBooleanTransformSchema.d.ts.map +1 -0
  45. package/dist/schemas/helperNodes/transforms/ConvertFromEnumTransformSchema.d.ts +16 -0
  46. package/dist/schemas/helperNodes/transforms/ConvertFromEnumTransformSchema.d.ts.map +1 -0
  47. package/dist/schemas/helperNodes/transforms/ConvertTransformSchema.d.ts +16 -0
  48. package/dist/schemas/helperNodes/transforms/ConvertTransformSchema.d.ts.map +1 -0
  49. package/dist/schemas/helperNodes/transforms/DateTransformSchema.d.ts +39 -0
  50. package/dist/schemas/helperNodes/transforms/DateTransformSchema.d.ts.map +1 -0
  51. package/dist/schemas/helperNodes/transforms/EqualsTransformSchema.d.ts +16 -0
  52. package/dist/schemas/helperNodes/transforms/EqualsTransformSchema.d.ts.map +1 -0
  53. package/dist/schemas/helperNodes/transforms/FeatureTransformSchema.d.ts +27 -0
  54. package/dist/schemas/helperNodes/transforms/FeatureTransformSchema.d.ts.map +1 -0
  55. package/dist/schemas/helperNodes/transforms/NoParamTransformSchema.d.ts +27 -0
  56. package/dist/schemas/helperNodes/transforms/NoParamTransformSchema.d.ts.map +1 -0
  57. package/dist/schemas/helperNodes/transforms/StringTransformSchema.d.ts +38 -0
  58. package/dist/schemas/helperNodes/transforms/StringTransformSchema.d.ts.map +1 -0
  59. package/dist/schemas/nodes/CollectionSchema.d.ts +4 -9
  60. package/dist/schemas/nodes/CollectionSchema.d.ts.map +1 -1
  61. package/dist/schemas/nodes/FragmentSchema.d.ts +1 -0
  62. package/dist/schemas/nodes/FragmentSchema.d.ts.map +1 -1
  63. package/dist/schemas/nodes/FrameSchema.d.ts +5 -10
  64. package/dist/schemas/nodes/FrameSchema.d.ts.map +1 -1
  65. package/dist/schemas/nodes/InstanceSchema.d.ts +2 -2
  66. package/dist/schemas/nodes/StopColorSchema.d.ts +8 -0
  67. package/dist/schemas/nodes/StopColorSchema.d.ts.map +1 -0
  68. package/dist/schemas/nodes/TextSchema.d.ts +3 -2
  69. package/dist/schemas/nodes/TextSchema.d.ts.map +1 -1
  70. package/dist/schemas/styles/FillSchema.d.ts +1 -0
  71. package/dist/schemas/styles/FillSchema.d.ts.map +1 -1
  72. package/dist/schemas/styles/SceneSchema.d.ts +1 -0
  73. package/dist/schemas/styles/SceneSchema.d.ts.map +1 -1
  74. package/dist/schemas/variables/ImageVariableSchema.d.ts +0 -1
  75. package/dist/schemas/variables/ImageVariableSchema.d.ts.map +1 -1
  76. package/dist/schemas/variables/StringVariableSchema.d.ts +1 -0
  77. package/dist/schemas/variables/StringVariableSchema.d.ts.map +1 -1
  78. package/package.json +1 -1
@@ -4,6 +4,7 @@ export declare const nodes: {
4
4
  FragmentInstance: "FragmentInstance";
5
5
  Instance: "Instance";
6
6
  Collection: "Collection";
7
+ ArrayItem: "ArrayItem";
7
8
  Breakpoint: "Breakpoint";
8
9
  Frame: "Frame";
9
10
  Image: "Image";
@@ -13,6 +14,18 @@ export declare const nodes: {
13
14
  Variable: "Variable";
14
15
  ComputedValue: "ComputedValue";
15
16
  TransformValue: "TransformValue";
17
+ StopColor: "StopColor";
18
+ LinearGradient: "LinearGradient";
19
+ CssChunk: "CssChunk";
20
+ Border: "Border";
21
+ Paint: "Paint";
22
+ Link: "Link";
23
+ Interaction: "Interaction";
24
+ Classname: "Classname";
25
+ GoalEvent: "GoalEvent";
26
+ MutateEvent: "MutateEvent";
27
+ TextHighlight: "TextHighlight";
28
+ ImagePaint: "ImagePaint";
16
29
  };
17
30
  export declare const fragmentGrowingMode: {
18
31
  auto: "auto";
@@ -30,8 +43,11 @@ export declare const linkTarget: {
30
43
  };
31
44
  export declare const paintMode: {
32
45
  Image: "Image";
46
+ LinearGradient: "LinearGradient";
33
47
  None: "None";
34
48
  Solid: "Solid";
49
+ RadialGradient: "RadialGradient";
50
+ ConicGradient: "ConicGradient";
35
51
  };
36
52
  export declare const imagePaintScaleModes: {
37
53
  Auto: "Auto";
@@ -101,9 +117,9 @@ export declare const effectName: {
101
117
  };
102
118
  export declare const variableType: {
103
119
  Image: "Image";
120
+ Link: "Link";
104
121
  Event: "Event";
105
122
  String: "String";
106
- Link: "Link";
107
123
  Boolean: "Boolean";
108
124
  Array: "Array";
109
125
  Color: "Color";
@@ -161,13 +177,19 @@ export declare const interactions: {
161
177
  };
162
178
  export declare const eventMode: {
163
179
  goal: "goal";
180
+ mutate: "mutate";
164
181
  callback: "callback";
165
182
  tracker: "tracker";
166
183
  };
167
184
  export declare const scopeTypes: {
185
+ AreaScope: "AreaScope";
168
186
  InstanceScope: "InstanceScope";
169
187
  FragmentScope: "FragmentScope";
170
188
  CollectionScope: "CollectionScope";
171
189
  CollectionItemScope: "CollectionItemScope";
172
190
  };
191
+ export declare const cssChunkScopeTypes: {
192
+ Fragment: "Fragment";
193
+ Global: "Global";
194
+ };
173
195
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,gBAAgB,CAAC,EAAE,QACtC,CAAC,YAI7B,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAcjB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAAkC,CAAC;AAEnE,eAAO,MAAM,UAAU;;;;;CAAuD,CAAC;AAC/E,eAAO,MAAM,UAAU;;;CAAoC,CAAC;AAC5D,eAAO,MAAM,SAAS;;;;CAA4C,CAAC;AACnE,eAAO,MAAM,oBAAoB;;;;CAA8C,CAAC;AAChF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AACF,eAAO,MAAM,YAAY;;;CAA0C,CAAC;AACpE,eAAO,MAAM,MAAM;;;;;CAAsD,CAAC;AAC1E,eAAO,MAAM,SAAS;;;CAAkC,CAAC;AACzD,eAAO,MAAM,cAAc;;;CAA4C,CAAC;AACxE,eAAO,MAAM,UAAU;;;;CAA4C,CAAC;AACpE,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AACF,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC;AACF,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AACF,eAAO,MAAM,UAAU;;;;;CAAoD,CAAC;AAC5E,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AACF,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAAiD,CAAC;AAEvE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAkB9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAAwC,CAAC;AAElE,eAAO,MAAM,UAAU;;;;CAAiD,CAAC;AAEzE,eAAO,MAAM,YAAY;;;;CAAkD,CAAC;AAE5E,eAAO,MAAM,SAAS;;;;CAAiD,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,gBAAgB,CAAC,EAAE,QACtC,CAAC,YAI7B,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BjB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAAkC,CAAC;AAEnE,eAAO,MAAM,UAAU;;;;;CAAuD,CAAC;AAC/E,eAAO,MAAM,UAAU;;;CAAoC,CAAC;AAC5D,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC;AACF,eAAO,MAAM,oBAAoB;;;;CAA8C,CAAC;AAChF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AACF,eAAO,MAAM,YAAY;;;CAA0C,CAAC;AACpE,eAAO,MAAM,MAAM;;;;;CAAsD,CAAC;AAC1E,eAAO,MAAM,SAAS;;;CAAkC,CAAC;AACzD,eAAO,MAAM,cAAc;;;CAA4C,CAAC;AACxE,eAAO,MAAM,UAAU;;;;CAA4C,CAAC;AACpE,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AACF,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC;AACF,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AACF,eAAO,MAAM,UAAU;;;;;CAAoD,CAAC;AAC5E,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AACF,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAAiD,CAAC;AAEvE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAkB9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAAwC,CAAC;AAElE,eAAO,MAAM,UAAU;;;;CAAiD,CAAC;AAEzE,eAAO,MAAM,YAAY;;;;CAAkD,CAAC;AAE5E,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;CAAwC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getLayerSchema.d.ts","sourceRoot":"","sources":["../../src/helpers/getLayerSchema.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,cAAc,WAAY,OAAO,QA2B7C,CAAC"}
1
+ {"version":3,"file":"getLayerSchema.d.ts","sourceRoot":"","sources":["../../src/helpers/getLayerSchema.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,cAAc,WAAY,OAAO,QAyC7C,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { variableType } from '../constants';
2
+ /**
3
+ * Получить входные типы для трансформации из схемы
4
+ */
5
+ export declare const getTransformInputTypes: (transformType: string) => Array<keyof typeof variableType> | null;
6
+ /**
7
+ * Получить входной тип для трансформации (для обратной совместимости)
8
+ * Возвращает первый тип из массива или "any" если массив большой
9
+ */
10
+ export declare const getTransformInputType: (transformType: string) => keyof typeof variableType | "any" | null;
11
+ /**
12
+ * Получить выходной тип для трансформации из схемы
13
+ * Для convert, convertFromBoolean и convertFromEnum нужно проверить outputType в самой схеме
14
+ */
15
+ export declare const getTransformOutputType: (transformType: string, transformOutputType?: keyof typeof variableType) => keyof typeof variableType | "any" | null;
16
+ /**
17
+ * Проверить совместимость типов между выходным типом предыдущей трансформации
18
+ * и входным типом следующей
19
+ */
20
+ export declare const isTransformCompatible: (previousOutputType: keyof typeof variableType | "any", nextInputTypes: Array<keyof typeof variableType> | "any" | keyof typeof variableType) => boolean;
21
+ /**
22
+ * Проверить, можно ли построить цепочку трансформаций от входного типа к выходному
23
+ */
24
+ export declare const canBuildTransformChain: (inputType: keyof typeof variableType, outputType: keyof typeof variableType, transforms: Array<{
25
+ type: string;
26
+ outputType?: keyof typeof variableType;
27
+ }>) => {
28
+ valid: boolean;
29
+ error?: string;
30
+ };
31
+ /**
32
+ * Получить список доступных трансформаций для входного типа
33
+ */
34
+ export declare const getAvailableTransforms: (inputType: keyof typeof variableType | "any") => string[];
35
+ /**
36
+ * Получить возможные пути трансформации от входного типа к выходному
37
+ * (упрощённая версия, возвращает первый найденный путь)
38
+ */
39
+ export declare const findTransformPath: (inputType: keyof typeof variableType, outputType: keyof typeof variableType, maxDepth?: number) => string[] | null;
40
+ export declare const transformTypeMap: Record<string, {
41
+ inputType: keyof typeof variableType | "any";
42
+ outputType: keyof typeof variableType | "any";
43
+ }>;
44
+ //# sourceMappingURL=transformTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformTypes.d.ts","sourceRoot":"","sources":["../../src/helpers/transformTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6B,MAAM,aAAa,CAAC;AAItE;;GAEG;AACH,eAAO,MAAM,sBAAsB,kBAClB,MAAM,KACpB,KAAK,CAAC,MAAM,OAAO,YAAY,CAAC,GAAG,IA2BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,kBACjB,MAAM,KACpB,MAAM,OAAO,YAAY,GAAG,KAAK,GAAG,IAMtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,kBAClB,MAAM,wBACC,MAAM,OAAO,YAAY,KAC9C,MAAM,OAAO,YAAY,GAAG,KAAK,GAAG,IAoCtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,uBACZ,MAAM,OAAO,YAAY,GAAG,KAAK,kBACrC,KAAK,CAAC,MAAM,OAAO,YAAY,CAAC,GAAG,KAAK,GAAG,MAAM,OAAO,YAAY,KACnF,OAaF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,cACtB,MAAM,OAAO,YAAY,cACxB,MAAM,OAAO,YAAY,cACzB,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACxC,CAAC,KACD;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAmDlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,cACtB,MAAM,OAAO,YAAY,GAAG,KAAK,KAC3C,MAAM,EAaR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,cACjB,MAAM,OAAO,YAAY,cACxB,MAAM,OAAO,YAAY,aAC3B,MAAM,KACf,MAAM,EAAE,GAAG,IA6Db,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN;IACE,SAAS,EAAE,MAAM,OAAO,YAAY,GAAG,KAAK,CAAC;IAC7C,UAAU,EAAE,MAAM,OAAO,YAAY,GAAG,KAAK,CAAC;CAC/C,CAWsH,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -11,6 +11,7 @@ const nodes = createConstants(
11
11
  "FragmentInstance",
12
12
  "Instance",
13
13
  "Collection",
14
+ "ArrayItem",
14
15
  "Breakpoint",
15
16
  "Frame",
16
17
  "Image",
@@ -19,12 +20,31 @@ const nodes = createConstants(
19
20
  "CssLink",
20
21
  "Variable",
21
22
  "ComputedValue",
22
- "TransformValue"
23
+ "TransformValue",
24
+ "StopColor",
25
+ "LinearGradient",
26
+ "CssChunk",
27
+ "Border",
28
+ "Paint",
29
+ "Link",
30
+ "Interaction",
31
+ "Classname",
32
+ "GoalEvent",
33
+ "MutateEvent",
34
+ "TextHighlight",
35
+ "ImagePaint"
23
36
  );
24
37
  const fragmentGrowingMode = createConstants("auto", "fill");
25
38
  const borderType = createConstants("None", "Solid", "Dashed", "Dotted");
26
39
  const linkTarget = createConstants("_blank", "none");
27
- const paintMode = createConstants("None", "Solid", "Image");
40
+ const paintMode = createConstants(
41
+ "None",
42
+ "Solid",
43
+ "LinearGradient",
44
+ "RadialGradient",
45
+ "ConicGradient",
46
+ "Image"
47
+ );
28
48
  const imagePaintScaleModes = createConstants("Auto", "Contain", "Cover");
29
49
  const constrain = createConstants(
30
50
  "Min",
@@ -113,18 +133,26 @@ const variableTransforms = createConstants(
113
133
  const renderTarget = createConstants("canvas", "document");
114
134
  const renderMode = createConstants("viewport", "parent", "fixed");
115
135
  const interactions = createConstants("click", "mouseover", "appear");
116
- const eventMode = createConstants("goal", "callback", "tracker");
136
+ const eventMode = createConstants(
137
+ "goal",
138
+ "mutate",
139
+ "callback",
140
+ "tracker"
141
+ );
117
142
  const scopeTypes = createConstants(
143
+ "AreaScope",
118
144
  "InstanceScope",
119
145
  "FragmentScope",
120
146
  "CollectionScope",
121
147
  "CollectionItemScope"
122
148
  );
149
+ const cssChunkScopeTypes = createConstants("Global", "Fragment");
123
150
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
124
151
  __proto__: null,
125
152
  borderType,
126
153
  constrain,
127
154
  createConstants,
155
+ cssChunkScopeTypes,
128
156
  effectName,
129
157
  effectType,
130
158
  eventMode,
@@ -1009,32 +1037,8 @@ const SceneSchema = /* @__PURE__ */ object({
1009
1037
  }),
1010
1038
  visible: layerField(/* @__PURE__ */ boolean(), { fallback: true, variable: true }),
1011
1039
  rotate: layerField(/* @__PURE__ */ number(), { fallback: null }),
1012
- zIndex: layerField(/* @__PURE__ */ number(), { fallback: -1 })
1013
- });
1014
- const FillSchema = /* @__PURE__ */ object({
1015
- fillType: layerField(/* @__PURE__ */ picklist(Object.keys(paintMode)), {
1016
- fallback: paintMode.None
1017
- }),
1018
- solidFill: layerField(/* @__PURE__ */ string(), { fallback: "#fff" }),
1019
- imageFill: layerField(/* @__PURE__ */ string()),
1020
- imageSize: layerField(/* @__PURE__ */ picklist(Object.keys(imagePaintScaleModes)), {
1021
- fallback: imagePaintScaleModes.Auto
1022
- })
1023
- });
1024
- const BorderSchema = /* @__PURE__ */ object({
1025
- borderType: layerField(/* @__PURE__ */ picklist(Object.keys(borderType)), {
1026
- fallback: borderType.None
1027
- }),
1028
- borderWidth: layerField(/* @__PURE__ */ string(), {
1029
- fallback: "1px",
1030
- transform: (value) => {
1031
- if (typeof value === "number") {
1032
- return `${value}px`;
1033
- }
1034
- return value;
1035
- }
1036
- }),
1037
- borderColor: layerField(/* @__PURE__ */ string(), { fallback: "#fff" })
1040
+ zIndex: layerField(/* @__PURE__ */ number(), { fallback: null }),
1041
+ classnames: layerField(/* @__PURE__ */ array(linkValidator), { fallback: [] })
1038
1042
  });
1039
1043
  const SizeSchema = /* @__PURE__ */ object({
1040
1044
  widthType: layerField(/* @__PURE__ */ picklist(Object.keys(sizing)), {
@@ -1103,28 +1107,11 @@ const OverflowSchema = layerField(/* @__PURE__ */ picklist(Object.keys(overflow)
1103
1107
  });
1104
1108
  const BorderRadiusSchema = layerField(/* @__PURE__ */ string(), { fallback: "0px" });
1105
1109
  const InteractionsSchema = /* @__PURE__ */ object({
1106
- interactions: layerField(
1107
- /* @__PURE__ */ array(
1108
- /* @__PURE__ */ object({
1109
- on: /* @__PURE__ */ enum_(Object.keys(interactions)),
1110
- event: /* @__PURE__ */ nullable(linkValidator)
1111
- })
1112
- ),
1113
- { fallback: [] }
1114
- )
1110
+ interactions: layerField(/* @__PURE__ */ array(linkValidator), { fallback: [] })
1115
1111
  });
1116
1112
  const CssOverrideSchema = /* @__PURE__ */ object({
1117
1113
  cssOverride: layerField(/* @__PURE__ */ string(), { fallback: "" })
1118
1114
  });
1119
- const LinkSchema = /* @__PURE__ */ object({
1120
- href: layerField(/* @__PURE__ */ string(), { fallback: null }),
1121
- hrefNewTab: layerField(/* @__PURE__ */ boolean(), {
1122
- fallback: true
1123
- })
1124
- // hrefTarget: layerField(v.picklist(Object.keys(linkTarget)), {
1125
- // fallback: linkTarget._blank,
1126
- // }),
1127
- });
1128
1115
  const FrameSchema = /* @__PURE__ */ pipe(
1129
1116
  /* @__PURE__ */ object({
1130
1117
  name: layerField(/* @__PURE__ */ string(), { fallback: "Frame", overridable: false }),
@@ -1133,19 +1120,19 @@ const FrameSchema = /* @__PURE__ */ pipe(
1133
1120
  overridable: false
1134
1121
  }),
1135
1122
  isPrimary: layerField(/* @__PURE__ */ boolean(), { fallback: false, overridable: false }),
1136
- parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1123
+ border: layerField(linkValidator),
1124
+ paint: layerField(linkValidator),
1125
+ link: layerField(linkValidator),
1137
1126
  ...ChildrenSchema.entries,
1138
1127
  ...GraphFieldSchema.entries,
1139
1128
  ...OverridesSchema.entries,
1129
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1140
1130
  ...PositionSchema.entries,
1141
1131
  ...SceneSchema.entries,
1142
- ...FillSchema.entries,
1143
- ...BorderSchema.entries,
1144
1132
  ...SizeSchema.entries,
1145
1133
  ...LayerSchema.entries,
1146
1134
  ...InteractionsSchema.entries,
1147
1135
  ...CssOverrideSchema.entries,
1148
- ...LinkSchema.entries,
1149
1136
  overflow: OverflowSchema,
1150
1137
  borderRadius: BorderRadiusSchema
1151
1138
  })
@@ -1160,14 +1147,15 @@ const TextSchema = /* @__PURE__ */ object({
1160
1147
  }),
1161
1148
  textAlign: layerField(/* @__PURE__ */ string(), { fallback: "left" }),
1162
1149
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1150
+ link: layerField(linkValidator),
1151
+ highlight: layerField(linkValidator),
1163
1152
  ...GraphFieldSchema.entries,
1164
1153
  ...OverridesSchema.entries,
1165
1154
  ...CssOverrideSchema.entries,
1166
1155
  ...PositionSchema.entries,
1167
1156
  ...SceneSchema.entries,
1168
1157
  ...SizeSchema.entries,
1169
- ...InteractionsSchema.entries,
1170
- ...LinkSchema.entries
1158
+ ...InteractionsSchema.entries
1171
1159
  });
1172
1160
  const FragmentSchema = /* @__PURE__ */ object({
1173
1161
  name: layerField(/* @__PURE__ */ string(), { fallback: "Fragment", overridable: false }),
@@ -1184,6 +1172,10 @@ const FragmentSchema = /* @__PURE__ */ object({
1184
1172
  fallback: [],
1185
1173
  overridable: false
1186
1174
  }),
1175
+ cssChunks: layerField(/* @__PURE__ */ array(linkValidator), {
1176
+ fallback: [],
1177
+ overridable: false
1178
+ }),
1187
1179
  ...GraphFieldSchema.entries,
1188
1180
  ...ChildrenSchema.entries
1189
1181
  });
@@ -1209,13 +1201,13 @@ const InstanceSchema = /* @__PURE__ */ object({
1209
1201
  fallback: {}
1210
1202
  }
1211
1203
  ),
1204
+ link: layerField(linkValidator),
1212
1205
  ...GraphFieldSchema.entries,
1213
1206
  ...OverridesSchema.entries,
1214
1207
  ...PositionSchema.entries,
1215
1208
  ...SizeSchema.entries,
1216
1209
  ...SceneSchema.entries,
1217
- ...InteractionsSchema.entries,
1218
- ...LinkSchema.entries
1210
+ ...InteractionsSchema.entries
1219
1211
  });
1220
1212
  const NumberVariableSchema = /* @__PURE__ */ object({
1221
1213
  nodePropertyControlReference: layerField(/* @__PURE__ */ string(), { fallback: null }),
@@ -1278,6 +1270,7 @@ const StringVariableSchema = /* @__PURE__ */ object({
1278
1270
  required: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1279
1271
  placeholder: layerField(/* @__PURE__ */ string(), { fallback: "" }),
1280
1272
  isTextarea: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1273
+ isRich: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1281
1274
  ...GraphFieldSchema.entries
1282
1275
  });
1283
1276
  const EventVariableSchema = /* @__PURE__ */ object({
@@ -1361,9 +1354,6 @@ const ImageVariableSchema = /* @__PURE__ */ object({
1361
1354
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1362
1355
  defaultValue: layerField(/* @__PURE__ */ string(), { fallback: null }),
1363
1356
  required: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1364
- imageSize: layerField(/* @__PURE__ */ picklist(Object.keys(imagePaintScaleModes)), {
1365
- fallback: imagePaintScaleModes.Auto
1366
- }),
1367
1357
  ...GraphFieldSchema.entries
1368
1358
  });
1369
1359
  const CollectionSchema = /* @__PURE__ */ pipe(
@@ -1374,18 +1364,18 @@ const CollectionSchema = /* @__PURE__ */ pipe(
1374
1364
  }),
1375
1365
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1376
1366
  source: layerField(linkValidator, {}),
1367
+ border: layerField(linkValidator),
1368
+ paint: layerField(linkValidator),
1369
+ link: layerField(linkValidator),
1377
1370
  ...ChildrenSchema.entries,
1378
1371
  ...GraphFieldSchema.entries,
1379
1372
  ...OverridesSchema.entries,
1380
1373
  ...PositionSchema.entries,
1381
1374
  ...SceneSchema.entries,
1382
- ...FillSchema.entries,
1383
- ...BorderSchema.entries,
1384
1375
  ...SizeSchema.entries,
1385
1376
  ...LayerSchema.entries,
1386
1377
  ...InteractionsSchema.entries,
1387
- ...CssOverrideSchema.entries,
1388
- ...LinkSchema.entries
1378
+ ...CssOverrideSchema.entries
1389
1379
  })
1390
1380
  );
1391
1381
  const ArrayVariableSchema = /* @__PURE__ */ object({
@@ -1398,11 +1388,132 @@ const ArrayVariableSchema = /* @__PURE__ */ object({
1398
1388
  fallback: variableType.Array
1399
1389
  }),
1400
1390
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1401
- defaultValue: layerField(/* @__PURE__ */ array(/* @__PURE__ */ any()), { fallback: [] }),
1391
+ defaultValue: layerField(/* @__PURE__ */ array(linkValidator), { fallback: [] }),
1402
1392
  definition: layerField(linkValidator, { fallback: null }),
1403
1393
  required: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1404
1394
  ...GraphFieldSchema.entries
1405
1395
  });
1396
+ const StopColorSchema = /* @__PURE__ */ object({
1397
+ ...OverridesSchema.entries,
1398
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1399
+ position: layerField(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ maxValue(1), /* @__PURE__ */ minValue(0)), {
1400
+ fallback: 0
1401
+ }),
1402
+ value: layerField(/* @__PURE__ */ string(), { fallback: "#000", variable: true }),
1403
+ ...GraphFieldSchema.entries
1404
+ });
1405
+ const LinearGradientSchema = /* @__PURE__ */ object({
1406
+ ...OverridesSchema.entries,
1407
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1408
+ angle: layerField(/* @__PURE__ */ number(), {
1409
+ fallback: 0
1410
+ }),
1411
+ stops: layerField(/* @__PURE__ */ array(linkValidator), { fallback: [] }),
1412
+ ...GraphFieldSchema.entries
1413
+ });
1414
+ const CssChunkSchema = /* @__PURE__ */ object({
1415
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1416
+ chunkId: layerField(/* @__PURE__ */ number()),
1417
+ // content: layerField(v.string(), {
1418
+ // fallback: "",
1419
+ // }),
1420
+ // scope: layerField(v.picklist(Object.keys(definition.cssChunkScopeTypes)), {
1421
+ // fallback: definition.cssChunkScopeTypes.Fragment,
1422
+ // }),
1423
+ enabled: layerField(/* @__PURE__ */ boolean(), {
1424
+ fallback: true,
1425
+ variable: true
1426
+ }),
1427
+ ...GraphFieldSchema.entries
1428
+ });
1429
+ const BorderSchema = /* @__PURE__ */ object({
1430
+ ...OverridesSchema.entries,
1431
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1432
+ type: layerField(/* @__PURE__ */ picklist(Object.keys(borderType)), {
1433
+ fallback: borderType.None
1434
+ }),
1435
+ width: layerField(/* @__PURE__ */ string(), {
1436
+ fallback: "1px",
1437
+ transform: (value) => {
1438
+ if (typeof value === "number") {
1439
+ return `${value}px`;
1440
+ }
1441
+ return value;
1442
+ }
1443
+ }),
1444
+ paint: layerField(linkValidator),
1445
+ ...GraphFieldSchema.entries
1446
+ });
1447
+ const PaintSchema = /* @__PURE__ */ object({
1448
+ ...OverridesSchema.entries,
1449
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1450
+ type: layerField(/* @__PURE__ */ picklist(Object.keys(paintMode)), {
1451
+ fallback: paintMode.None
1452
+ }),
1453
+ solid: layerField(/* @__PURE__ */ string(), { fallback: "#fff" }),
1454
+ linearGradient: layerField(linkValidator),
1455
+ image: layerField(linkValidator),
1456
+ ...GraphFieldSchema.entries
1457
+ });
1458
+ const ImagePaintSchema = /* @__PURE__ */ object({
1459
+ ...GraphFieldSchema.entries,
1460
+ ...OverridesSchema.entries,
1461
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1462
+ src: layerField(/* @__PURE__ */ string()),
1463
+ scale: layerField(/* @__PURE__ */ picklist(Object.keys(imagePaintScaleModes)), {
1464
+ fallback: imagePaintScaleModes.Auto
1465
+ })
1466
+ });
1467
+ const LinkSchema = /* @__PURE__ */ object({
1468
+ ...OverridesSchema.entries,
1469
+ ...GraphFieldSchema.entries,
1470
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1471
+ href: layerField(/* @__PURE__ */ string(), { fallback: null }),
1472
+ isNewTab: layerField(/* @__PURE__ */ boolean(), {
1473
+ fallback: true
1474
+ })
1475
+ });
1476
+ const InteractionSchema = /* @__PURE__ */ object({
1477
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1478
+ ...GraphFieldSchema.entries,
1479
+ on: /* @__PURE__ */ enum_(Object.keys(interactions)),
1480
+ event: layerField(linkValidator)
1481
+ });
1482
+ const ClassnameSchema = /* @__PURE__ */ object({
1483
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1484
+ value: layerField(/* @__PURE__ */ string(), { fallback: "" }),
1485
+ enabled: layerField(/* @__PURE__ */ boolean(), {
1486
+ fallback: true,
1487
+ variable: true
1488
+ }),
1489
+ ...GraphFieldSchema.entries
1490
+ });
1491
+ const GoalEventSchema = /* @__PURE__ */ object({
1492
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1493
+ goalId: layerField(/* @__PURE__ */ number(), { overridable: false }),
1494
+ ...GraphFieldSchema.entries
1495
+ });
1496
+ const MutateEventSchema = /* @__PURE__ */ object({
1497
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1498
+ target: layerField(linkValidator),
1499
+ value: layerField(/* @__PURE__ */ any()),
1500
+ ...GraphFieldSchema.entries
1501
+ });
1502
+ const TextHighlightSchema = /* @__PURE__ */ object({
1503
+ color: layerField(/* @__PURE__ */ string(), { fallback: null }),
1504
+ lineHeight: layerField(/* @__PURE__ */ number(), { fallback: null }),
1505
+ fontSize: layerField(/* @__PURE__ */ number(), { fallback: null }),
1506
+ textDecoration: layerField(/* @__PURE__ */ picklist(Object.keys(textDecorations)), {
1507
+ fallback: null
1508
+ }),
1509
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1510
+ ...GraphFieldSchema.entries
1511
+ });
1512
+ const ArrayItemSchema = /* @__PURE__ */ object({
1513
+ parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
1514
+ value: layerField(/* @__PURE__ */ any(), { fallback: null }),
1515
+ ...GraphFieldSchema.entries
1516
+ });
1406
1517
  const getLayerSchema = (layer) => {
1407
1518
  if (!(layer == null ? void 0 : layer._type)) return null;
1408
1519
  if ((layer == null ? void 0 : layer._type) === nodes.Frame) return FrameSchema;
@@ -1410,6 +1521,19 @@ const getLayerSchema = (layer) => {
1410
1521
  if ((layer == null ? void 0 : layer._type) === nodes.Fragment) return FragmentSchema;
1411
1522
  if ((layer == null ? void 0 : layer._type) === nodes.Instance) return InstanceSchema;
1412
1523
  if ((layer == null ? void 0 : layer._type) === nodes.Collection) return CollectionSchema;
1524
+ if ((layer == null ? void 0 : layer._type) === nodes.StopColor) return StopColorSchema;
1525
+ if ((layer == null ? void 0 : layer._type) === nodes.LinearGradient) return LinearGradientSchema;
1526
+ if ((layer == null ? void 0 : layer._type) === nodes.CssChunk) return CssChunkSchema;
1527
+ if ((layer == null ? void 0 : layer._type) === nodes.Border) return BorderSchema;
1528
+ if ((layer == null ? void 0 : layer._type) === nodes.Paint) return PaintSchema;
1529
+ if ((layer == null ? void 0 : layer._type) === nodes.ImagePaint) return ImagePaintSchema;
1530
+ if ((layer == null ? void 0 : layer._type) === nodes.Link) return LinkSchema;
1531
+ if ((layer == null ? void 0 : layer._type) === nodes.Interaction) return InteractionSchema;
1532
+ if ((layer == null ? void 0 : layer._type) === nodes.Classname) return ClassnameSchema;
1533
+ if ((layer == null ? void 0 : layer._type) === nodes.GoalEvent) return GoalEventSchema;
1534
+ if ((layer == null ? void 0 : layer._type) === nodes.MutateEvent) return MutateEventSchema;
1535
+ if ((layer == null ? void 0 : layer._type) === nodes.TextHighlight) return TextHighlightSchema;
1536
+ if ((layer == null ? void 0 : layer._type) === nodes.ArrayItem) return ArrayItemSchema;
1413
1537
  if (layer._type === nodes.Variable) {
1414
1538
  const types = {
1415
1539
  [variableType.Number]: NumberVariableSchema,