@prismicio/types-internal 2.0.0-alpha.1 → 2.0.0-alpha.3

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 (258) hide show
  1. package/lib/common/WidgetKey.d.ts +1 -1
  2. package/lib/common/WidgetKey.js +1 -1
  3. package/lib/common/index.js +1 -1
  4. package/lib/content/Document.d.ts +4 -4
  5. package/lib/content/Document.js +1 -1
  6. package/lib/content/LegacyContentCtx.d.ts +2 -2
  7. package/lib/content/LegacyContentCtx.js +1 -1
  8. package/lib/content/fields/EmptyContent.d.ts +1 -1
  9. package/lib/content/fields/EmptyContent.js +1 -1
  10. package/lib/content/fields/GroupContent.d.ts +4 -4
  11. package/lib/content/fields/GroupContent.js +1 -1
  12. package/lib/content/fields/UIDContent.d.ts +1 -1
  13. package/lib/content/fields/UIDContent.js +1 -1
  14. package/lib/content/fields/WidgetContent.d.ts +2 -2
  15. package/lib/content/fields/WidgetContent.js +1 -1
  16. package/lib/content/fields/index.js +5 -5
  17. package/lib/content/fields/nestable/BooleanContent.d.ts +1 -1
  18. package/lib/content/fields/nestable/BooleanContent.js +1 -1
  19. package/lib/content/fields/nestable/EmbedContent.d.ts +2 -2
  20. package/lib/content/fields/nestable/EmbedContent.js +1 -1
  21. package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +1 -1
  22. package/lib/content/fields/nestable/FieldContent/ColorContent.js +2 -2
  23. package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +1 -1
  24. package/lib/content/fields/nestable/FieldContent/DateContent.js +2 -2
  25. package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +1 -1
  26. package/lib/content/fields/nestable/FieldContent/NumberContent.js +2 -2
  27. package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +1 -1
  28. package/lib/content/fields/nestable/FieldContent/RangeContent.js +2 -2
  29. package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +1 -1
  30. package/lib/content/fields/nestable/FieldContent/SelectContent.js +2 -2
  31. package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +1 -1
  32. package/lib/content/fields/nestable/FieldContent/TextContent.js +2 -2
  33. package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +1 -1
  34. package/lib/content/fields/nestable/FieldContent/TimestampContent.js +2 -2
  35. package/lib/content/fields/nestable/FieldContent/index.d.ts +2 -2
  36. package/lib/content/fields/nestable/FieldContent/index.js +9 -9
  37. package/lib/content/fields/nestable/GeoPointContent.d.ts +1 -1
  38. package/lib/content/fields/nestable/GeoPointContent.js +1 -1
  39. package/lib/content/fields/nestable/ImageContent.d.ts +2 -2
  40. package/lib/content/fields/nestable/ImageContent.js +1 -1
  41. package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +1 -1
  42. package/lib/content/fields/nestable/IntegrationFieldContent.js +1 -1
  43. package/lib/content/fields/nestable/LinkContent.d.ts +6 -6
  44. package/lib/content/fields/nestable/LinkContent.js +1 -1
  45. package/lib/content/fields/nestable/NestableContent.d.ts +2 -2
  46. package/lib/content/fields/nestable/NestableContent.js +1 -1
  47. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +7 -7
  48. package/lib/content/fields/nestable/RichTextContent/Blocks.js +2 -2
  49. package/lib/content/fields/nestable/RichTextContent/index.d.ts +1 -1
  50. package/lib/content/fields/nestable/RichTextContent/index.js +2 -2
  51. package/lib/content/fields/nestable/SeparatorContent.d.ts +1 -1
  52. package/lib/content/fields/nestable/SeparatorContent.js +1 -1
  53. package/lib/content/fields/nestable/index.js +10 -10
  54. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +1 -1
  55. package/lib/content/fields/slices/Slice/CompositeSliceContent.js +1 -1
  56. package/lib/content/fields/slices/Slice/RepeatableContent.js +1 -1
  57. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +1 -1
  58. package/lib/content/fields/slices/Slice/SharedSliceContent.js +1 -1
  59. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +1 -1
  60. package/lib/content/fields/slices/Slice/SimpleSliceContent.js +1 -1
  61. package/lib/content/fields/slices/Slice/index.d.ts +1 -1
  62. package/lib/content/fields/slices/Slice/index.js +1 -1
  63. package/lib/content/fields/slices/SliceItem.d.ts +1 -1
  64. package/lib/content/fields/slices/SliceItem.js +1 -1
  65. package/lib/content/fields/slices/SlicesContent.d.ts +2 -2
  66. package/lib/content/fields/slices/SlicesContent.js +1 -1
  67. package/lib/content/fields/slices/index.js +5 -5
  68. package/lib/content/index.js +3 -3
  69. package/lib/content/utils.d.ts +2 -2
  70. package/lib/content/utils.js +2 -4
  71. package/lib/customtypes/CustomType.d.ts +2 -2
  72. package/lib/customtypes/CustomType.js +1 -1
  73. package/lib/customtypes/Section.d.ts +2 -2
  74. package/lib/customtypes/Section.js +1 -1
  75. package/lib/customtypes/diff/Changes.d.ts +4 -4
  76. package/lib/customtypes/diff/SharedSlice.d.ts +3 -671
  77. package/lib/customtypes/diff/Variation.d.ts +3 -657
  78. package/lib/customtypes/diff/index.js +3 -3
  79. package/lib/customtypes/index.js +4 -4
  80. package/lib/customtypes/widgets/Group.d.ts +1 -1
  81. package/lib/customtypes/widgets/Group.js +1 -1
  82. package/lib/customtypes/widgets/UID.d.ts +1 -1
  83. package/lib/customtypes/widgets/UID.js +1 -1
  84. package/lib/customtypes/widgets/Widget.d.ts +3 -3
  85. package/lib/customtypes/widgets/Widget.js +3 -3
  86. package/lib/customtypes/widgets/index.js +6 -6
  87. package/lib/customtypes/widgets/nestable/BooleanField.d.ts +2 -2
  88. package/lib/customtypes/widgets/nestable/BooleanField.js +1 -1
  89. package/lib/customtypes/widgets/nestable/Color.d.ts +2 -2
  90. package/lib/customtypes/widgets/nestable/Color.js +1 -1
  91. package/lib/customtypes/widgets/nestable/Date.d.ts +2 -2
  92. package/lib/customtypes/widgets/nestable/Date.js +1 -1
  93. package/lib/customtypes/widgets/nestable/Embed.d.ts +2 -2
  94. package/lib/customtypes/widgets/nestable/Embed.js +1 -1
  95. package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +2 -2
  96. package/lib/customtypes/widgets/nestable/GeoPoint.js +1 -1
  97. package/lib/customtypes/widgets/nestable/Image.d.ts +3 -3
  98. package/lib/customtypes/widgets/nestable/Image.js +2 -2
  99. package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +2 -2
  100. package/lib/customtypes/widgets/nestable/IntegrationField.js +1 -1
  101. package/lib/customtypes/widgets/nestable/Link.d.ts +2 -2
  102. package/lib/customtypes/widgets/nestable/Link.js +1 -1
  103. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +2 -2
  104. package/lib/customtypes/widgets/nestable/NestableWidget.js +1 -1
  105. package/lib/customtypes/widgets/nestable/Number.d.ts +2 -2
  106. package/lib/customtypes/widgets/nestable/Number.js +1 -1
  107. package/lib/customtypes/widgets/nestable/Range.d.ts +2 -2
  108. package/lib/customtypes/widgets/nestable/Range.js +1 -1
  109. package/lib/customtypes/widgets/nestable/RichText.d.ts +3 -3
  110. package/lib/customtypes/widgets/nestable/RichText.js +2 -2
  111. package/lib/customtypes/widgets/nestable/Select.d.ts +2 -2
  112. package/lib/customtypes/widgets/nestable/Select.js +1 -1
  113. package/lib/customtypes/widgets/nestable/Separator.d.ts +2 -2
  114. package/lib/customtypes/widgets/nestable/Separator.js +1 -1
  115. package/lib/customtypes/widgets/nestable/Text.d.ts +2 -2
  116. package/lib/customtypes/widgets/nestable/Text.js +1 -1
  117. package/lib/customtypes/widgets/nestable/Timestamp.d.ts +2 -2
  118. package/lib/customtypes/widgets/nestable/Timestamp.js +1 -1
  119. package/lib/customtypes/widgets/nestable/index.js +16 -16
  120. package/lib/customtypes/widgets/shared/ImageConstraint.d.ts +1 -1
  121. package/lib/customtypes/widgets/shared/ImageConstraint.js +1 -1
  122. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +1 -1
  123. package/lib/customtypes/widgets/slices/CompositeSlice.js +1 -1
  124. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +1 -1
  125. package/lib/customtypes/widgets/slices/LegacySlice.js +2 -2
  126. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +2 -2
  127. package/lib/customtypes/widgets/slices/SharedSlice.js +1 -1
  128. package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -1
  129. package/lib/customtypes/widgets/slices/SharedSliceRef.js +1 -1
  130. package/lib/customtypes/widgets/slices/Slice.d.ts +2 -2
  131. package/lib/customtypes/widgets/slices/Slices.d.ts +5 -5
  132. package/lib/customtypes/widgets/slices/Slices.js +4 -4
  133. package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +1 -1
  134. package/lib/customtypes/widgets/slices/SlicesTypes.js +1 -1
  135. package/lib/customtypes/widgets/slices/index.js +6 -6
  136. package/lib/utils/index.js +2 -2
  137. package/lib/validators/DateFromString.js +1 -1
  138. package/lib/validators/DateFromStringOrNumber.js +1 -1
  139. package/lib/validators/DateFromTsMs.js +1 -1
  140. package/lib/validators/IntFromNumber.d.ts +2 -2
  141. package/lib/validators/IntFromNumber.js +1 -1
  142. package/lib/validators/IntFromPixels.d.ts +2 -2
  143. package/lib/validators/IntFromPixels.js +1 -1
  144. package/lib/validators/NonEmptyString.js +1 -1
  145. package/lib/validators/NonEmptyStringOrNull.js +1 -1
  146. package/lib/validators/NumberOrNull.js +1 -1
  147. package/lib/validators/StringFromBoolean.d.ts +2 -2
  148. package/lib/validators/StringFromBoolean.js +1 -1
  149. package/lib/validators/StringFromNumber.d.ts +2 -2
  150. package/lib/validators/StringFromNumber.js +1 -1
  151. package/lib/validators/StringOrNull.js +1 -1
  152. package/lib/validators/TrimmedString.d.ts +2 -2
  153. package/lib/validators/TrimmedString.js +1 -1
  154. package/lib/validators/function.js +1 -1
  155. package/lib/validators/index.js +12 -12
  156. package/package.json +1 -1
  157. package/lib/content/CustomType.d.ts +0 -2972
  158. package/lib/content/CustomType.js +0 -15
  159. package/lib/content/fields/nestable/FieldContent.d.ts +0 -32
  160. package/lib/content/fields/nestable/FieldContent.js +0 -37
  161. package/lib/content/fields/nestable/Image.d.ts +0 -103
  162. package/lib/content/fields/nestable/Image.js +0 -13
  163. package/lib/content/fields/nestable/RichTextContent.d.ts +0 -376
  164. package/lib/content/fields/nestable/RichTextContent.js +0 -16
  165. package/lib/content/fields/slices/CompositeSliceContent.d.ts +0 -677
  166. package/lib/content/fields/slices/CompositeSliceContent.js +0 -14
  167. package/lib/content/fields/slices/RepeatableContent.d.ts +0 -338
  168. package/lib/content/fields/slices/RepeatableContent.js +0 -16
  169. package/lib/content/fields/slices/SharedSliceContent.d.ts +0 -678
  170. package/lib/content/fields/slices/SharedSliceContent.js +0 -15
  171. package/lib/content/fields/slices/SimpleSliceContent.d.ts +0 -675
  172. package/lib/content/fields/slices/SimpleSliceContent.js +0 -8
  173. package/lib/customtypes/Comparators/Changes.d.ts +0 -17
  174. package/lib/customtypes/Comparators/Changes.js +0 -9
  175. package/lib/customtypes/Comparators/SharedSlice.d.ts +0 -679
  176. package/lib/customtypes/Comparators/SharedSlice.js +0 -55
  177. package/lib/customtypes/Comparators/Variation.d.ts +0 -662
  178. package/lib/customtypes/Comparators/Variation.js +0 -75
  179. package/lib/customtypes/Comparators/index.d.ts +0 -3
  180. package/lib/customtypes/Comparators/index.js +0 -6
  181. package/lib/customtypes/Format.d.ts +0 -4
  182. package/lib/customtypes/Format.js +0 -8
  183. package/lib/customtypes/comp/Changes.d.ts +0 -17
  184. package/lib/customtypes/comp/Changes.js +0 -9
  185. package/lib/customtypes/comp/SharedSlice.d.ts +0 -679
  186. package/lib/customtypes/comp/SharedSlice.js +0 -55
  187. package/lib/customtypes/comp/Variation.d.ts +0 -662
  188. package/lib/customtypes/comp/Variation.js +0 -76
  189. package/lib/customtypes/comp/index.d.ts +0 -3
  190. package/lib/customtypes/comp/index.js +0 -6
  191. package/lib/customtypes/utils/Comparator.d.ts +0 -1353
  192. package/lib/customtypes/utils/Comparator.js +0 -59
  193. package/lib/customtypes/utils/index.d.ts +0 -1
  194. package/lib/customtypes/utils/index.js +0 -4
  195. package/lib/customtypes/widgets/WidgetTypes.d.ts +0 -22
  196. package/lib/customtypes/widgets/WidgetTypes.js +0 -25
  197. package/lib/documents/DocumentData.d.ts +0 -6
  198. package/lib/documents/DocumentData.js +0 -15
  199. package/lib/documents/index.d.ts +0 -2
  200. package/lib/documents/index.js +0 -7
  201. package/lib/documents/widgets/EmptyContent.d.ts +0 -8
  202. package/lib/documents/widgets/EmptyContent.js +0 -9
  203. package/lib/documents/widgets/GroupContent.d.ts +0 -16
  204. package/lib/documents/widgets/GroupContent.js +0 -60
  205. package/lib/documents/widgets/SimpleWidgetContent.d.ts +0 -20
  206. package/lib/documents/widgets/SimpleWidgetContent.js +0 -75
  207. package/lib/documents/widgets/StaticWidgetContent.d.ts +0 -10
  208. package/lib/documents/widgets/StaticWidgetContent.js +0 -26
  209. package/lib/documents/widgets/UIDContent.d.ts +0 -7
  210. package/lib/documents/widgets/UIDContent.js +0 -10
  211. package/lib/documents/widgets/index.d.ts +0 -38
  212. package/lib/documents/widgets/index.js +0 -40
  213. package/lib/documents/widgets/nestable/BooleanContent.d.ts +0 -8
  214. package/lib/documents/widgets/nestable/BooleanContent.js +0 -11
  215. package/lib/documents/widgets/nestable/EmbedContent.d.ts +0 -42
  216. package/lib/documents/widgets/nestable/EmbedContent.js +0 -35
  217. package/lib/documents/widgets/nestable/FieldContent.d.ts +0 -13
  218. package/lib/documents/widgets/nestable/FieldContent.js +0 -37
  219. package/lib/documents/widgets/nestable/GeoPointContent.d.ts +0 -17
  220. package/lib/documents/widgets/nestable/GeoPointContent.js +0 -13
  221. package/lib/documents/widgets/nestable/ImageContent.d.ts +0 -127
  222. package/lib/documents/widgets/nestable/ImageContent.js +0 -41
  223. package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +0 -8
  224. package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +0 -16
  225. package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +0 -12
  226. package/lib/documents/widgets/nestable/Link/DocumentLink.js +0 -13
  227. package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +0 -24
  228. package/lib/documents/widgets/nestable/Link/ExternalLink.js +0 -24
  229. package/lib/documents/widgets/nestable/Link/FileLink.d.ts +0 -22
  230. package/lib/documents/widgets/nestable/Link/FileLink.js +0 -25
  231. package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +0 -28
  232. package/lib/documents/widgets/nestable/Link/ImageLink.js +0 -26
  233. package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +0 -42
  234. package/lib/documents/widgets/nestable/Link/LinkContent.js +0 -17
  235. package/lib/documents/widgets/nestable/Link/index.d.ts +0 -90
  236. package/lib/documents/widgets/nestable/Link/index.js +0 -35
  237. package/lib/documents/widgets/nestable/SeparatorContent.d.ts +0 -11
  238. package/lib/documents/widgets/nestable/SeparatorContent.js +0 -15
  239. package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +0 -314
  240. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +0 -98
  241. package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +0 -9
  242. package/lib/documents/widgets/nestable/StructuredTextContent/index.js +0 -14
  243. package/lib/documents/widgets/nestable/index.d.ts +0 -26
  244. package/lib/documents/widgets/nestable/index.js +0 -39
  245. package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +0 -14
  246. package/lib/documents/widgets/slices/CompositeSliceContent.js +0 -52
  247. package/lib/documents/widgets/slices/SharedSliceContent.d.ts +0 -15
  248. package/lib/documents/widgets/slices/SharedSliceContent.js +0 -63
  249. package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +0 -6
  250. package/lib/documents/widgets/slices/SimpleSliceContent.js +0 -6
  251. package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +0 -8
  252. package/lib/documents/widgets/slices/SliceWidgetContent.js +0 -26
  253. package/lib/documents/widgets/slices/SlicesContent.d.ts +0 -17
  254. package/lib/documents/widgets/slices/SlicesContent.js +0 -52
  255. package/lib/documents/widgets/slices/index.d.ts +0 -5
  256. package/lib/documents/widgets/slices/index.js +0 -8
  257. package/lib/index.d.ts +0 -3
  258. package/lib/index.js +0 -7
@@ -1,314 +0,0 @@
1
- import * as t from "io-ts";
2
- export declare const Meta: t.ExactC<t.IntersectionC<[t.PartialC<{
3
- data: t.UnknownC;
4
- }>, t.TypeC<{
5
- start: t.NumberC;
6
- end: t.NumberC;
7
- type: t.UnionC<[t.KeyofC<{
8
- heading1: null;
9
- heading2: null;
10
- heading3: null;
11
- heading4: null;
12
- heading5: null;
13
- heading6: null;
14
- paragraph: null;
15
- strong: null;
16
- em: null;
17
- preformatted: null;
18
- hyperlink: null;
19
- image: null;
20
- embed: null;
21
- "list-item": null;
22
- "o-list-item": null;
23
- rtl: null;
24
- }>, t.LiteralC<"label">]>;
25
- }>]>>;
26
- export declare type Meta = t.TypeOf<typeof Meta>;
27
- export declare const Span: t.ExactC<t.IntersectionC<[t.PartialC<{
28
- data: t.UnknownC;
29
- }>, t.TypeC<{
30
- start: t.NumberC;
31
- end: t.NumberC;
32
- type: t.UnionC<[t.KeyofC<{
33
- heading1: null;
34
- heading2: null;
35
- heading3: null;
36
- heading4: null;
37
- heading5: null;
38
- heading6: null;
39
- paragraph: null;
40
- strong: null;
41
- em: null;
42
- preformatted: null;
43
- hyperlink: null;
44
- image: null;
45
- embed: null;
46
- "list-item": null;
47
- "o-list-item": null;
48
- rtl: null;
49
- }>, t.LiteralC<"label">]>;
50
- }>]>>;
51
- export declare type Span = Meta;
52
- export declare const ValidatedMetas: t.Type<({
53
- data?: unknown;
54
- } & {
55
- start: number;
56
- end: number;
57
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
58
- })[], ({
59
- data?: unknown;
60
- } & {
61
- start: number;
62
- end: number;
63
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
64
- })[], unknown>;
65
- export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
66
- type: t.LiteralC<"image">;
67
- data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
68
- origin: t.ExactC<t.TypeC<{
69
- id: t.StringC;
70
- url: t.StringC;
71
- width: t.NumberC;
72
- height: t.NumberC;
73
- }>>;
74
- width: t.NumberC;
75
- height: t.NumberC;
76
- edit: t.TypeC<{
77
- zoom: t.NumberC;
78
- crop: t.TypeC<{
79
- x: t.NumberC;
80
- y: t.NumberC;
81
- }>;
82
- background: t.StringC;
83
- }>;
84
- }>, t.PartialC<{
85
- url: t.StringC;
86
- credits: t.Type<string | null, string | null, unknown>;
87
- alt: t.Type<string | null, string | null, unknown>;
88
- provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
89
- }>]>>, t.PartialC<{
90
- linkTo: t.UnionC<[t.Type<{
91
- id: string;
92
- } | ({
93
- url: string;
94
- } & {
95
- kind?: "web";
96
- target?: string | null | undefined;
97
- preview?: {
98
- title?: string;
99
- } | null | undefined;
100
- }) | ({
101
- id: string;
102
- url: string;
103
- name: string;
104
- kind: string;
105
- } & {
106
- date?: string | null | undefined;
107
- size?: string;
108
- }) | ({
109
- id: string;
110
- url: string;
111
- height: string;
112
- width: string;
113
- size: string;
114
- name: string;
115
- kind: string;
116
- } & {
117
- date?: string | null | undefined;
118
- }), ({
119
- id: string;
120
- } & {
121
- __TYPE__: "DocumentLink";
122
- }) | ({
123
- url: string;
124
- } & {
125
- kind?: "web";
126
- target?: string | null | undefined;
127
- preview?: {
128
- title?: string;
129
- } | null | undefined;
130
- } & {
131
- __TYPE__: "ExternalLink";
132
- }) | {
133
- readonly size: string;
134
- readonly __TYPE__: "FileLink";
135
- readonly id: string;
136
- readonly url: string;
137
- readonly name: string;
138
- readonly kind: string;
139
- readonly date?: string | null | undefined;
140
- } | ({
141
- id: string;
142
- url: string;
143
- height: string;
144
- width: string;
145
- size: string;
146
- name: string;
147
- kind: string;
148
- } & {
149
- date?: string | null | undefined;
150
- } & {
151
- __TYPE__: "ImageLink";
152
- }), unknown>, t.NullC, t.UndefinedC]>;
153
- }>]>;
154
- }>, t.PartialC<{
155
- label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
156
- direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
157
- }>]>>;
158
- export declare type ImageBlock = t.TypeOf<typeof ImageBlock>;
159
- export declare function checkImageBlock(block: Block): block is ImageBlock;
160
- export declare const EmbedBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
161
- type: t.LiteralC<"embed">;
162
- data: t.Type<import("../EmbedContent").EmbedContentO, unknown, unknown>;
163
- }>, t.PartialC<{
164
- label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
165
- direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
166
- }>]>>;
167
- export declare type EmbedBlock = t.TypeOf<typeof EmbedBlock>;
168
- export declare function checkEmbedBlock(block: Block): block is EmbedBlock;
169
- export declare const TextBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
170
- type: t.Type<"paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
171
- content: t.IntersectionC<[t.TypeC<{
172
- text: t.StringC;
173
- }>, t.PartialC<{
174
- spans: t.Type<({
175
- data?: unknown;
176
- } & {
177
- start: number;
178
- end: number;
179
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
180
- })[], ({
181
- data?: unknown;
182
- } & {
183
- start: number;
184
- end: number;
185
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
186
- })[], unknown>;
187
- }>]>;
188
- }>, t.PartialC<{
189
- label: t.StringC;
190
- direction: t.StringC;
191
- }>]>>;
192
- export declare type TextBlock = t.TypeOf<typeof TextBlock>;
193
- export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
194
- type: t.LiteralC<"image">;
195
- data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
196
- origin: t.ExactC<t.TypeC<{
197
- id: t.StringC;
198
- url: t.StringC;
199
- width: t.NumberC;
200
- height: t.NumberC;
201
- }>>;
202
- width: t.NumberC;
203
- height: t.NumberC;
204
- edit: t.TypeC<{
205
- zoom: t.NumberC;
206
- crop: t.TypeC<{
207
- x: t.NumberC;
208
- y: t.NumberC;
209
- }>;
210
- background: t.StringC;
211
- }>;
212
- }>, t.PartialC<{
213
- url: t.StringC;
214
- credits: t.Type<string | null, string | null, unknown>;
215
- alt: t.Type<string | null, string | null, unknown>;
216
- provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
217
- }>]>>, t.PartialC<{
218
- linkTo: t.UnionC<[t.Type<{
219
- id: string;
220
- } | ({
221
- url: string;
222
- } & {
223
- kind?: "web";
224
- target?: string | null | undefined;
225
- preview?: {
226
- title?: string;
227
- } | null | undefined;
228
- }) | ({
229
- id: string;
230
- url: string;
231
- name: string;
232
- kind: string;
233
- } & {
234
- date?: string | null | undefined;
235
- size?: string;
236
- }) | ({
237
- id: string;
238
- url: string;
239
- height: string;
240
- width: string;
241
- size: string;
242
- name: string;
243
- kind: string;
244
- } & {
245
- date?: string | null | undefined;
246
- }), ({
247
- id: string;
248
- } & {
249
- __TYPE__: "DocumentLink";
250
- }) | ({
251
- url: string;
252
- } & {
253
- kind?: "web";
254
- target?: string | null | undefined;
255
- preview?: {
256
- title?: string;
257
- } | null | undefined;
258
- } & {
259
- __TYPE__: "ExternalLink";
260
- }) | {
261
- readonly size: string;
262
- readonly __TYPE__: "FileLink";
263
- readonly id: string;
264
- readonly url: string;
265
- readonly name: string;
266
- readonly kind: string;
267
- readonly date?: string | null | undefined;
268
- } | ({
269
- id: string;
270
- url: string;
271
- height: string;
272
- width: string;
273
- size: string;
274
- name: string;
275
- kind: string;
276
- } & {
277
- date?: string | null | undefined;
278
- } & {
279
- __TYPE__: "ImageLink";
280
- }), unknown>, t.NullC, t.UndefinedC]>;
281
- }>]>;
282
- }>, t.PartialC<{
283
- label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
284
- direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
285
- }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
286
- type: t.LiteralC<"embed">;
287
- data: t.Type<import("../EmbedContent").EmbedContentO, unknown, unknown>;
288
- }>, t.PartialC<{
289
- label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
290
- direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
291
- }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
292
- type: t.Type<"paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
293
- content: t.IntersectionC<[t.TypeC<{
294
- text: t.StringC;
295
- }>, t.PartialC<{
296
- spans: t.Type<({
297
- data?: unknown;
298
- } & {
299
- start: number;
300
- end: number;
301
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
302
- })[], ({
303
- data?: unknown;
304
- } & {
305
- start: number;
306
- end: number;
307
- type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
308
- })[], unknown>;
309
- }>]>;
310
- }>, t.PartialC<{
311
- label: t.StringC;
312
- direction: t.StringC;
313
- }>]>>]>;
314
- export declare type Block = t.TypeOf<typeof Block>;
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Block = exports.TextBlock = exports.checkEmbedBlock = exports.EmbedBlock = exports.checkImageBlock = exports.ImageBlock = exports.ValidatedMetas = exports.Span = exports.Meta = void 0;
4
- const tslib_1 = require("tslib");
5
- const E = (0, tslib_1.__importStar)(require("fp-ts/lib/Either"));
6
- const t = (0, tslib_1.__importStar)(require("io-ts"));
7
- const nestable_1 = require("../../../../customtypes/widgets/nestable");
8
- const validators_1 = require("../../../../validators");
9
- const function_1 = require("../../../../validators/function");
10
- const EmbedContent_1 = require("../EmbedContent");
11
- const ImageContent_1 = require("../ImageContent");
12
- const Link_1 = require("../Link");
13
- exports.Meta = t.exact(t.intersection([
14
- t.partial({
15
- data: t.unknown,
16
- }),
17
- t.type({
18
- start: t.number,
19
- end: t.number,
20
- type: t.union([nestable_1.RichTextNodeTypeCodec, t.literal("label")]),
21
- }),
22
- ]));
23
- // export alias for code clarity
24
- exports.Span = exports.Meta;
25
- exports.ValidatedMetas = new t.Type("ValidatedMetas", (metas) => Array.isArray(metas) && metas.every(exports.Meta.is), (metas, c) => {
26
- if (Array.isArray(metas)) {
27
- const res = metas
28
- .reduce((acc, maybeMeta) => {
29
- const maybeDecodedMeta = exports.Meta.decode(maybeMeta);
30
- if (E.isRight(maybeDecodedMeta)) {
31
- const meta = maybeDecodedMeta.right;
32
- // if it's an hyperlink it should have data validated as link otherwise we don't care and keep the meta
33
- if ((meta.data &&
34
- meta.type === "hyperlink" &&
35
- E.isRight(Link_1.Link.validate(meta.data, c))) ||
36
- meta.type !== "hyperlink") {
37
- return [...acc, meta];
38
- }
39
- }
40
- return acc;
41
- }, [])
42
- .sort((m1, m2) => m1.start - m2.start);
43
- return t.success(res);
44
- }
45
- else
46
- return t.failure(metas, c);
47
- }, (m) => t.array(exports.Meta).encode(m));
48
- exports.ImageBlock = t.exact(t.intersection([
49
- t.type({
50
- type: t.literal(nestable_1.RichTextNodeType.image),
51
- data: t.intersection([
52
- ImageContent_1.ImageContentView,
53
- t.partial({
54
- linkTo: (0, function_1.nullable)(Link_1.Link),
55
- }),
56
- ]),
57
- }),
58
- t.partial({
59
- label: validators_1.StringOrNull,
60
- direction: validators_1.StringOrNull,
61
- }),
62
- ]));
63
- function checkImageBlock(block) {
64
- return block.type === nestable_1.RichTextNodeType.image;
65
- }
66
- exports.checkImageBlock = checkImageBlock;
67
- exports.EmbedBlock = t.exact(t.intersection([
68
- t.type({
69
- type: t.literal(nestable_1.RichTextNodeType.embed),
70
- data: EmbedContent_1.EmbedContent,
71
- }),
72
- t.partial({
73
- label: validators_1.StringOrNull,
74
- direction: validators_1.StringOrNull,
75
- }),
76
- ]));
77
- function checkEmbedBlock(block) {
78
- return block.type === nestable_1.RichTextNodeType.embed;
79
- }
80
- exports.checkEmbedBlock = checkEmbedBlock;
81
- exports.TextBlock = t.exact(t.intersection([
82
- t.type({
83
- type: (0, function_1.refineType)(nestable_1.RichTextNodeTypeCodec, `string which isn't ${nestable_1.RichTextNodeType.image} ${nestable_1.RichTextNodeType.embed}`, (s) => s !== nestable_1.RichTextNodeType.image && s !== nestable_1.RichTextNodeType.embed),
84
- content: t.intersection([
85
- t.type({
86
- text: t.string,
87
- }),
88
- t.partial({
89
- spans: exports.ValidatedMetas,
90
- }),
91
- ]),
92
- }),
93
- t.partial({
94
- label: t.string,
95
- direction: t.string,
96
- }),
97
- ]));
98
- exports.Block = t.union([exports.ImageBlock, exports.EmbedBlock, exports.TextBlock]);
@@ -1,9 +0,0 @@
1
- import * as t from "io-ts";
2
- import { Block } from "./Block";
3
- export declare const StructuredTextContentType = "StructuredTextContent";
4
- export declare type StructuredTextContent = {
5
- value: Block[];
6
- __TYPE__: typeof StructuredTextContentType;
7
- };
8
- export declare const StructuredTextContent: t.Type<StructuredTextContent, string, unknown>;
9
- export * as Blocks from "./Block";
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Blocks = exports.StructuredTextContent = exports.StructuredTextContentType = void 0;
4
- const tslib_1 = require("tslib");
5
- const Either_1 = require("fp-ts/Either");
6
- const t = (0, tslib_1.__importStar)(require("io-ts"));
7
- const Block_1 = require("./Block");
8
- exports.StructuredTextContentType = "StructuredTextContent";
9
- exports.StructuredTextContent = new t.Type(exports.StructuredTextContentType, (u) => { var _a; return ((_a = u) === null || _a === void 0 ? void 0 : _a.__TYPE__) === exports.StructuredTextContentType; }, (u, c) => Either_1.Chain.chain(t.array(Block_1.Block).validate(u, c), (u) => {
10
- return t.success({ value: u, __TYPE__: exports.StructuredTextContentType });
11
- }), () => {
12
- throw new Error("NotImplementedError: Not relevant method");
13
- });
14
- exports.Blocks = (0, tslib_1.__importStar)(require("./Block"));
@@ -1,26 +0,0 @@
1
- export { default as BooleanContent } from "./BooleanContent";
2
- export * from "./EmbedContent";
3
- export { default as FieldContent } from "./FieldContent";
4
- export { type GeoPointContentO, GeoPointContent } from "./GeoPointContent";
5
- export { type ImageContentO, ImageContent, ImageContentView, } from "./ImageContent";
6
- export { default as IntegrationFieldsContent } from "./IntegrationFieldsContent";
7
- export * as Links from "./Link";
8
- export * from "./SeparatorContent";
9
- export * from "./StructuredTextContent";
10
- export declare const NestableTypes: {
11
- readonly Links: {
12
- readonly DocumentLink: "DocumentLink";
13
- readonly FileLink: "FileLink";
14
- readonly ExternalLink: "ExternalLink";
15
- readonly ImageLink: "ImageLink";
16
- readonly LinkContent: "LinkContent";
17
- };
18
- readonly StructuredText: "StructuredTextContent";
19
- readonly Boolean: "BooleanContent";
20
- readonly Embed: "EmbedContent";
21
- readonly Field: "FieldContent";
22
- readonly GeoPoint: "GeoPointContent";
23
- readonly Image: "ImageContent";
24
- readonly IntegrationFields: "IntegrationFieldsContent";
25
- readonly Separator: "SeparatorContent";
26
- };
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NestableTypes = exports.Links = exports.IntegrationFieldsContent = exports.ImageContentView = exports.ImageContent = exports.GeoPointContent = exports.FieldContent = exports.BooleanContent = void 0;
4
- const tslib_1 = require("tslib");
5
- const BooleanContent_1 = require("./BooleanContent");
6
- const EmbedContent_1 = require("./EmbedContent");
7
- const FieldContent_1 = require("./FieldContent");
8
- const GeoPointContent_1 = require("./GeoPointContent");
9
- const ImageContent_1 = require("./ImageContent");
10
- const IntegrationFieldsContent_1 = require("./IntegrationFieldsContent");
11
- const Link_1 = require("./Link");
12
- const SeparatorContent_1 = require("./SeparatorContent");
13
- const StructuredTextContent_1 = require("./StructuredTextContent");
14
- var BooleanContent_2 = require("./BooleanContent");
15
- Object.defineProperty(exports, "BooleanContent", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BooleanContent_2).default; } });
16
- (0, tslib_1.__exportStar)(require("./EmbedContent"), exports);
17
- var FieldContent_2 = require("./FieldContent");
18
- Object.defineProperty(exports, "FieldContent", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(FieldContent_2).default; } });
19
- var GeoPointContent_2 = require("./GeoPointContent");
20
- Object.defineProperty(exports, "GeoPointContent", { enumerable: true, get: function () { return GeoPointContent_2.GeoPointContent; } });
21
- var ImageContent_2 = require("./ImageContent");
22
- Object.defineProperty(exports, "ImageContent", { enumerable: true, get: function () { return ImageContent_2.ImageContent; } });
23
- Object.defineProperty(exports, "ImageContentView", { enumerable: true, get: function () { return ImageContent_2.ImageContentView; } });
24
- var IntegrationFieldsContent_2 = require("./IntegrationFieldsContent");
25
- Object.defineProperty(exports, "IntegrationFieldsContent", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(IntegrationFieldsContent_2).default; } });
26
- exports.Links = (0, tslib_1.__importStar)(require("./Link"));
27
- (0, tslib_1.__exportStar)(require("./SeparatorContent"), exports);
28
- (0, tslib_1.__exportStar)(require("./StructuredTextContent"), exports);
29
- exports.NestableTypes = {
30
- Links: Link_1.LinksTypes,
31
- StructuredText: StructuredTextContent_1.StructuredTextContentType,
32
- Boolean: BooleanContent_1.BooleanContentType,
33
- Embed: EmbedContent_1.EmbedContentType,
34
- Field: FieldContent_1.FieldContentType,
35
- GeoPoint: GeoPointContent_1.GeoPointContentType,
36
- Image: ImageContent_1.ImageContentType,
37
- IntegrationFields: IntegrationFieldsContent_1.IntegrationFieldsContentType,
38
- Separator: SeparatorContent_1.SeparatorContentType,
39
- };
@@ -1,14 +0,0 @@
1
- import * as O from "fp-ts/Option";
2
- import type { GroupItemContent } from "../GroupContent";
3
- import { SimpleWidgetContent } from "../index";
4
- export declare const CompositeSliceContentType = "CompositeSliceContent";
5
- export declare type CompositeSliceContent = {
6
- repeat: GroupItemContent[];
7
- nonRepeat: {
8
- [key: string]: SimpleWidgetContent;
9
- };
10
- __TYPE__: typeof CompositeSliceContentType;
11
- };
12
- export declare const CompositeSliceContent: {
13
- fromJson: (prefixes: Array<string>, key: string, value: unknown, fieldTypes: Map<string, string>, fieldPositions: Map<string, number>) => O.Option<CompositeSliceContent>;
14
- };
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompositeSliceContent = exports.CompositeSliceContentType = void 0;
4
- const tslib_1 = require("tslib");
5
- const Either_1 = require("fp-ts/Either");
6
- const O = (0, tslib_1.__importStar)(require("fp-ts/Option"));
7
- const t = (0, tslib_1.__importStar)(require("io-ts"));
8
- const index_1 = require("../index");
9
- exports.CompositeSliceContentType = "CompositeSliceContent";
10
- const codec = t.exact(t.partial({
11
- repeat: t.array(t.unknown),
12
- "non-repeat": t.UnknownRecord,
13
- }));
14
- exports.CompositeSliceContent = {
15
- fromJson: (prefixes, key, value, fieldTypes, fieldPositions) => {
16
- var _a;
17
- const prefixedRepeatKey = Array.of(prefixes, [key, "repeat"])
18
- .flat()
19
- .join(".");
20
- const decodedValue = codec.decode(value);
21
- if ((0, Either_1.isRight)(decodedValue)) {
22
- const repeatObj = decodedValue.right.repeat;
23
- const nonRepeatObj = (_a = decodedValue.right["non-repeat"]) !== null && _a !== void 0 ? _a : {};
24
- const groupItemsContentsRepeat = index_1.GroupContent.itemsContentsFromJson(prefixedRepeatKey, repeatObj, fieldTypes, fieldPositions);
25
- const sortedFields = Object.entries(nonRepeatObj).sort(([k1], [k2]) => {
26
- var _a, _b;
27
- const p1 = (_a = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`)) !== null && _a !== void 0 ? _a : 10000;
28
- const p2 = (_b = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`)) !== null && _b !== void 0 ? _b : 10000;
29
- return p1 - p2;
30
- });
31
- const nonRepeat = sortedFields.reduce((acc, [k, v]) => {
32
- const kp = Array.of(prefixes, [key, "non-repeat", k]).flat().join(".");
33
- const kind = fieldTypes.get(kp);
34
- if (kind) {
35
- const mWidgetContent = index_1.SimpleWidgetContent.from(kind, v);
36
- if (O.isSome(mWidgetContent)) {
37
- acc[k] = mWidgetContent.value;
38
- }
39
- }
40
- return acc;
41
- }, {});
42
- return O.some({
43
- repeat: groupItemsContentsRepeat,
44
- nonRepeat,
45
- __TYPE__: "CompositeSliceContent",
46
- });
47
- }
48
- else {
49
- return O.none;
50
- }
51
- },
52
- };
@@ -1,15 +0,0 @@
1
- import * as O from "fp-ts/Option";
2
- import type { GroupItemContent } from "../GroupContent";
3
- import { SimpleWidgetContent } from "../index";
4
- export declare const SharedSliceContentType = "SharedSliceContent";
5
- export declare type SharedSliceContent = {
6
- variation: string;
7
- primary: {
8
- [key: string]: SimpleWidgetContent;
9
- };
10
- items: GroupItemContent[];
11
- __TYPE__: typeof SharedSliceContentType;
12
- };
13
- export declare const SharedSliceContent: {
14
- fromJson: (prefixes: Array<string>, key: string, value: unknown, fieldTypes: Map<string, string>, fieldPositions: Map<string, number>) => O.Option<SharedSliceContent>;
15
- };
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SharedSliceContent = exports.SharedSliceContentType = void 0;
4
- const tslib_1 = require("tslib");
5
- const Either_1 = require("fp-ts/Either");
6
- const O = (0, tslib_1.__importStar)(require("fp-ts/Option"));
7
- const t = (0, tslib_1.__importStar)(require("io-ts"));
8
- const io_ts_types_1 = require("io-ts-types");
9
- const index_1 = require("../index");
10
- exports.SharedSliceContentType = "SharedSliceContent";
11
- const codec = t.exact(t.type({
12
- variation: t.string,
13
- items: (0, io_ts_types_1.withFallback)(t.array(t.unknown), []),
14
- primary: (0, io_ts_types_1.withFallback)(t.UnknownRecord, {}),
15
- }));
16
- exports.SharedSliceContent = {
17
- fromJson: (prefixes, key, value, fieldTypes, fieldPositions) => {
18
- const r = (0, Either_1.map)((v) => {
19
- const prefixedItemsKey = Array.of(prefixes, [
20
- key,
21
- "variations",
22
- v.variation,
23
- "items",
24
- ])
25
- .flat()
26
- .join(".");
27
- const groupItemsContents = index_1.GroupContent.itemsContentsFromJson(prefixedItemsKey, v.items, fieldTypes, fieldPositions);
28
- const sortedFields = Object.entries(v.primary).sort(([k1], [k2]) => {
29
- var _a, _b;
30
- const p1 = (_a = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`)) !== null && _a !== void 0 ? _a : 10000;
31
- const p2 = (_b = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`)) !== null && _b !== void 0 ? _b : 10000;
32
- return p1 - p2;
33
- });
34
- const primary = sortedFields.reduce((acc, [k, w]) => {
35
- const kp = Array.of(prefixes, [
36
- key,
37
- "variations",
38
- v.variation,
39
- "primary",
40
- k,
41
- ])
42
- .flat()
43
- .join(".");
44
- const kind = fieldTypes.get(kp);
45
- if (kind) {
46
- const maybeWidgetContent = index_1.SimpleWidgetContent.from(kind, w);
47
- if (O.isSome(maybeWidgetContent)) {
48
- acc[k] = maybeWidgetContent.value;
49
- }
50
- }
51
- return acc;
52
- }, {});
53
- const result = {
54
- variation: v.variation,
55
- primary,
56
- items: groupItemsContents,
57
- __TYPE__: "SharedSliceContent",
58
- };
59
- return result;
60
- })(codec.decode(value));
61
- return O.fromEither(r);
62
- },
63
- };
@@ -1,6 +0,0 @@
1
- import StaticWidgetContent from "../StaticWidgetContent";
2
- export declare type SimpleSliceContent = StaticWidgetContent;
3
- export declare const SimpleSliceContent: {
4
- fromJson: (prefixes: string[], key: string, value: unknown, fieldTypes: Map<string, string>, fieldPositions: Map<string, number>) => import("fp-ts/lib/Option").Option<StaticWidgetContent>;
5
- is: (value: unknown) => value is StaticWidgetContent;
6
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleSliceContent = void 0;
4
- const tslib_1 = require("tslib");
5
- const StaticWidgetContent_1 = (0, tslib_1.__importDefault)(require("../StaticWidgetContent"));
6
- exports.SimpleSliceContent = StaticWidgetContent_1.default;