@prismicio/types-internal 4.6.0-pr.25.41a8b18 → 4.6.0-pr.26.ebb6cbc

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 (253) hide show
  1. package/dist/common/asset.d.ts +1 -2
  2. package/dist/common/asset.d.ts.map +1 -1
  3. package/dist/common/asset.js.map +1 -1
  4. package/dist/common/embed.d.ts +1 -2
  5. package/dist/common/embed.d.ts.map +1 -1
  6. package/dist/common/embed.js.map +1 -1
  7. package/dist/common/hexaColorCode.d.ts +1 -2
  8. package/dist/common/hexaColorCode.d.ts.map +1 -1
  9. package/dist/common/hexaColorCode.js.map +1 -1
  10. package/dist/common/nonEmptyString.d.ts +1 -2
  11. package/dist/common/nonEmptyString.d.ts.map +1 -1
  12. package/dist/common/nonEmptyString.js.map +1 -1
  13. package/dist/common/widgetKey.d.ts +1 -2
  14. package/dist/common/widgetKey.d.ts.map +1 -1
  15. package/dist/common/widgetKey.js.map +1 -1
  16. package/dist/content/boolean.d.ts +1 -2
  17. package/dist/content/boolean.d.ts.map +1 -1
  18. package/dist/content/boolean.js.map +1 -1
  19. package/dist/content/codec/boolean.js.map +1 -1
  20. package/dist/content/codec/document.js.map +1 -1
  21. package/dist/content/codec/embed.js.map +1 -1
  22. package/dist/content/codec/empty.js.map +1 -1
  23. package/dist/content/codec/field.js.map +1 -1
  24. package/dist/content/codec/geopoint.js.map +1 -1
  25. package/dist/content/codec/group.js +6 -4
  26. package/dist/content/codec/group.js.map +1 -1
  27. package/dist/content/codec/image.js.map +1 -1
  28. package/dist/content/codec/integrationField.js.map +1 -1
  29. package/dist/content/codec/legacyContentCtx.d.ts +2 -15
  30. package/dist/content/codec/legacyContentCtx.d.ts.map +1 -1
  31. package/dist/content/codec/legacyContentCtx.js.map +1 -1
  32. package/dist/content/codec/link.js.map +1 -1
  33. package/dist/content/codec/nestable.js.map +1 -1
  34. package/dist/content/codec/repeatable.js.map +1 -1
  35. package/dist/content/codec/richText.js.map +1 -1
  36. package/dist/content/codec/separator.js.map +1 -1
  37. package/dist/content/codec/slice.js.map +1 -1
  38. package/dist/content/codec/slices.js.map +1 -1
  39. package/dist/content/codec/table.js.map +1 -1
  40. package/dist/content/codec/uid.js.map +1 -1
  41. package/dist/content/codec/widget.js.map +1 -1
  42. package/dist/content/document.d.ts +1 -2
  43. package/dist/content/document.d.ts.map +1 -1
  44. package/dist/content/document.js.map +1 -1
  45. package/dist/content/embed.d.ts +1 -2
  46. package/dist/content/embed.d.ts.map +1 -1
  47. package/dist/content/embed.js.map +1 -1
  48. package/dist/content/empty.d.ts +1 -2
  49. package/dist/content/empty.d.ts.map +1 -1
  50. package/dist/content/empty.js.map +1 -1
  51. package/dist/content/field.d.ts +1 -2
  52. package/dist/content/field.d.ts.map +1 -1
  53. package/dist/content/field.js.map +1 -1
  54. package/dist/content/geopoint.d.ts +1 -2
  55. package/dist/content/geopoint.d.ts.map +1 -1
  56. package/dist/content/geopoint.js.map +1 -1
  57. package/dist/content/group.d.ts +3 -2
  58. package/dist/content/group.d.ts.map +1 -1
  59. package/dist/content/group.js.map +1 -1
  60. package/dist/content/image.d.ts +1 -2
  61. package/dist/content/image.d.ts.map +1 -1
  62. package/dist/content/image.js.map +1 -1
  63. package/dist/content/integrationField.d.ts +1 -2
  64. package/dist/content/integrationField.d.ts.map +1 -1
  65. package/dist/content/integrationField.js.map +1 -1
  66. package/dist/content/legacy/boolean.js.map +1 -1
  67. package/dist/content/legacy/document.d.ts +1 -2
  68. package/dist/content/legacy/document.d.ts.map +1 -1
  69. package/dist/content/legacy/document.js.map +1 -1
  70. package/dist/content/legacy/embed.js.map +1 -1
  71. package/dist/content/legacy/empty.js.map +1 -1
  72. package/dist/content/legacy/field.js.map +1 -1
  73. package/dist/content/legacy/geopoint.js.map +1 -1
  74. package/dist/content/legacy/group.d.ts +2 -2
  75. package/dist/content/legacy/group.d.ts.map +1 -1
  76. package/dist/content/legacy/group.js.map +1 -1
  77. package/dist/content/legacy/image.d.ts +0 -1
  78. package/dist/content/legacy/image.d.ts.map +1 -1
  79. package/dist/content/legacy/image.js.map +1 -1
  80. package/dist/content/legacy/integrationField.js.map +1 -1
  81. package/dist/content/legacy/link.d.ts +1 -2
  82. package/dist/content/legacy/link.d.ts.map +1 -1
  83. package/dist/content/legacy/link.js.map +1 -1
  84. package/dist/content/legacy/nestable.d.ts +12 -0
  85. package/dist/content/legacy/nestable.js.map +1 -1
  86. package/dist/content/legacy/repeatable.js.map +1 -1
  87. package/dist/content/legacy/richText.d.ts +5 -2
  88. package/dist/content/legacy/richText.d.ts.map +1 -1
  89. package/dist/content/legacy/richText.js.map +1 -1
  90. package/dist/content/legacy/separator.js.map +1 -1
  91. package/dist/content/legacy/slice.js +1 -1
  92. package/dist/content/legacy/slice.js.map +1 -1
  93. package/dist/content/legacy/slices.js.map +1 -1
  94. package/dist/content/legacy/table.d.ts +2 -0
  95. package/dist/content/legacy/table.js.map +1 -1
  96. package/dist/content/legacy/uid.js.map +1 -1
  97. package/dist/content/link.d.ts +7 -8
  98. package/dist/content/link.d.ts.map +1 -1
  99. package/dist/content/link.js.map +1 -1
  100. package/dist/content/nestable.d.ts +0 -1
  101. package/dist/content/nestable.d.ts.map +1 -1
  102. package/dist/content/nestable.js.map +1 -1
  103. package/dist/content/repeatable.d.ts +3 -4
  104. package/dist/content/repeatable.d.ts.map +1 -1
  105. package/dist/content/repeatable.js.map +1 -1
  106. package/dist/content/richText.d.ts +2 -3
  107. package/dist/content/richText.d.ts.map +1 -1
  108. package/dist/content/richText.js +2 -2
  109. package/dist/content/richText.js.map +1 -1
  110. package/dist/content/separator.d.ts +1 -2
  111. package/dist/content/separator.d.ts.map +1 -1
  112. package/dist/content/separator.js.map +1 -1
  113. package/dist/content/slice.d.ts +13 -14
  114. package/dist/content/slice.d.ts.map +1 -1
  115. package/dist/content/slice.js.map +1 -1
  116. package/dist/content/slices.d.ts +13 -14
  117. package/dist/content/slices.d.ts.map +1 -1
  118. package/dist/content/slices.js.map +1 -1
  119. package/dist/content/table.d.ts +1 -2
  120. package/dist/content/table.d.ts.map +1 -1
  121. package/dist/content/table.js.map +1 -1
  122. package/dist/content/uid.d.ts +1 -2
  123. package/dist/content/uid.d.ts.map +1 -1
  124. package/dist/content/uid.js.map +1 -1
  125. package/dist/content/widget.d.ts +0 -1
  126. package/dist/content/widget.d.ts.map +1 -1
  127. package/dist/content/widget.js.map +1 -1
  128. package/dist/helpers/contentPath.d.ts +1 -1
  129. package/dist/helpers/contentPath.d.ts.map +1 -1
  130. package/dist/helpers/contentPath.js +1 -1
  131. package/dist/helpers/contentPath.js.map +1 -1
  132. package/dist/helpers/customTypeModel.d.ts +1 -3
  133. package/dist/helpers/customTypeModel.d.ts.map +1 -1
  134. package/dist/helpers/customTypeModel.js +1 -1
  135. package/dist/helpers/customTypeModel.js.map +1 -1
  136. package/dist/helpers/documentContent.d.ts +1 -3
  137. package/dist/helpers/documentContent.d.ts.map +1 -1
  138. package/dist/helpers/documentContent.js +1 -1
  139. package/dist/helpers/documentContent.js.map +1 -1
  140. package/dist/helpers/fieldModel.d.ts +1 -1
  141. package/dist/helpers/fieldModel.d.ts.map +1 -1
  142. package/dist/helpers/fieldModel.js +1 -1
  143. package/dist/helpers/fieldModel.js.map +1 -1
  144. package/dist/helpers/imageContent.d.ts +2 -6
  145. package/dist/helpers/imageContent.d.ts.map +1 -1
  146. package/dist/helpers/imageContent.js +1 -1
  147. package/dist/helpers/imageContent.js.map +1 -1
  148. package/dist/helpers/repository.d.ts +1 -1
  149. package/dist/helpers/repository.d.ts.map +1 -1
  150. package/dist/helpers/repository.js +1 -1
  151. package/dist/helpers/repository.js.map +1 -1
  152. package/dist/helpers/sliceContent.d.ts +1 -3
  153. package/dist/helpers/sliceContent.d.ts.map +1 -1
  154. package/dist/helpers/sliceContent.js.map +1 -1
  155. package/dist/helpers/sliceModel.d.ts +1 -1
  156. package/dist/helpers/sliceModel.d.ts.map +1 -1
  157. package/dist/helpers/sliceModel.js +1 -1
  158. package/dist/helpers/sliceModel.js.map +1 -1
  159. package/dist/helpers/traverseContent.d.ts +0 -1
  160. package/dist/helpers/traverseContent.d.ts.map +1 -1
  161. package/dist/helpers/traverseContent.js.map +1 -1
  162. package/dist/helpers/traverseContentWithModel.d.ts +0 -1
  163. package/dist/helpers/traverseContentWithModel.d.ts.map +1 -1
  164. package/dist/helpers/traverseContentWithModel.js.map +1 -1
  165. package/dist/helpers/withDefaultContent.d.ts +1 -3
  166. package/dist/helpers/withDefaultContent.d.ts.map +1 -1
  167. package/dist/helpers/withDefaultContent.js +1 -1
  168. package/dist/helpers/withDefaultContent.js.map +1 -1
  169. package/dist/io-ts.d.ts +1153 -1159
  170. package/dist/io-ts.d.ts.map +1 -1
  171. package/dist/io-ts.js.map +1 -1
  172. package/dist/model/boolean.d.ts +1 -2
  173. package/dist/model/boolean.d.ts.map +1 -1
  174. package/dist/model/boolean.js.map +1 -1
  175. package/dist/model/color.d.ts +1 -2
  176. package/dist/model/color.d.ts.map +1 -1
  177. package/dist/model/color.js.map +1 -1
  178. package/dist/model/customType.d.ts +3 -4
  179. package/dist/model/customType.d.ts.map +1 -1
  180. package/dist/model/customType.js +1 -1
  181. package/dist/model/customType.js.map +1 -1
  182. package/dist/model/date.d.ts +1 -2
  183. package/dist/model/date.d.ts.map +1 -1
  184. package/dist/model/date.js.map +1 -1
  185. package/dist/model/embed.d.ts +1 -2
  186. package/dist/model/embed.d.ts.map +1 -1
  187. package/dist/model/embed.js.map +1 -1
  188. package/dist/model/geopoint.d.ts +1 -2
  189. package/dist/model/geopoint.d.ts.map +1 -1
  190. package/dist/model/geopoint.js.map +1 -1
  191. package/dist/model/group.d.ts +39 -40
  192. package/dist/model/group.d.ts.map +1 -1
  193. package/dist/model/group.js +1 -1
  194. package/dist/model/group.js.map +1 -1
  195. package/dist/model/image.d.ts +1 -2
  196. package/dist/model/image.d.ts.map +1 -1
  197. package/dist/model/image.js +1 -1
  198. package/dist/model/image.js.map +1 -1
  199. package/dist/model/integrationField.d.ts +1 -2
  200. package/dist/model/integrationField.d.ts.map +1 -1
  201. package/dist/model/integrationField.js.map +1 -1
  202. package/dist/model/link.d.ts +2 -3
  203. package/dist/model/link.d.ts.map +1 -1
  204. package/dist/model/link.js.map +1 -1
  205. package/dist/model/nestable.d.ts +0 -1
  206. package/dist/model/nestable.d.ts.map +1 -1
  207. package/dist/model/nestable.js.map +1 -1
  208. package/dist/model/number.d.ts +1 -2
  209. package/dist/model/number.d.ts.map +1 -1
  210. package/dist/model/number.js.map +1 -1
  211. package/dist/model/range.d.ts +1 -2
  212. package/dist/model/range.d.ts.map +1 -1
  213. package/dist/model/range.js.map +1 -1
  214. package/dist/model/richText.d.ts +1 -2
  215. package/dist/model/richText.d.ts.map +1 -1
  216. package/dist/model/richText.js +1 -1
  217. package/dist/model/richText.js.map +1 -1
  218. package/dist/model/select.d.ts +1 -2
  219. package/dist/model/select.d.ts.map +1 -1
  220. package/dist/model/select.js.map +1 -1
  221. package/dist/model/separator.d.ts +1 -2
  222. package/dist/model/separator.d.ts.map +1 -1
  223. package/dist/model/separator.js.map +1 -1
  224. package/dist/model/slice.d.ts +44 -45
  225. package/dist/model/slice.d.ts.map +1 -1
  226. package/dist/model/slice.js +1 -1
  227. package/dist/model/slice.js.map +1 -1
  228. package/dist/model/slices.d.ts +1 -2
  229. package/dist/model/slices.d.ts.map +1 -1
  230. package/dist/model/slices.js +1 -1
  231. package/dist/model/slices.js.map +1 -1
  232. package/dist/model/table.d.ts +3 -3
  233. package/dist/model/table.d.ts.map +1 -1
  234. package/dist/model/table.js.map +1 -1
  235. package/dist/model/text.d.ts +1 -2
  236. package/dist/model/text.d.ts.map +1 -1
  237. package/dist/model/text.js.map +1 -1
  238. package/dist/model/timestamp.d.ts +1 -2
  239. package/dist/model/timestamp.d.ts.map +1 -1
  240. package/dist/model/timestamp.js.map +1 -1
  241. package/dist/model/uid.d.ts +1 -2
  242. package/dist/model/uid.d.ts.map +1 -1
  243. package/dist/model/uid.js.map +1 -1
  244. package/dist/model/widget.d.ts +25 -26
  245. package/dist/model/widget.d.ts.map +1 -1
  246. package/dist/model/widget.js +1 -1
  247. package/dist/model/widget.js.map +1 -1
  248. package/dist/zod4.d.ts +3351 -3353
  249. package/dist/zod4.d.ts.map +1 -1
  250. package/dist/zod4.js.map +1 -1
  251. package/package.json +11 -12
  252. package/src/helpers/customTypeModel.ts +3 -1
  253. package/src/model/image.ts +4 -1
@@ -3,7 +3,6 @@ import { RichTextContentBlock } from "./richText.js";
3
3
  import { GroupItemContent } from "./group.js";
4
4
  import { SliceContent } from "./slice.js";
5
5
  import { z } from "zod/mini";
6
-
7
6
  //#region src/content/slices.d.ts
8
7
  declare const LegacySliceItemContentSchema: z.ZodMiniObject<{
9
8
  key: z.ZodMiniString<string>;
@@ -96,12 +95,12 @@ declare const LegacySliceItemContentSchema: z.ZodMiniObject<{
96
95
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
97
96
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
98
97
  }, z.core.$strip>>, z.ZodMiniTransform<{
99
- variant?: string | undefined;
100
98
  text?: string | undefined;
99
+ variant?: string | undefined;
101
100
  } & LinkContentValue, {
102
- value: LinkContentValue;
103
101
  text?: string | undefined;
104
102
  variant?: string | undefined;
103
+ value: LinkContentValue;
105
104
  }>>;
106
105
  }, z.core.$strip>, z.ZodMiniObject<{
107
106
  __TYPE__: z.ZodMiniLiteral<"RepeatableContent">;
@@ -118,12 +117,12 @@ declare const LegacySliceItemContentSchema: z.ZodMiniObject<{
118
117
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
119
118
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
120
119
  }, z.core.$strip>>, z.ZodMiniTransform<{
121
- variant?: string | undefined;
122
120
  text?: string | undefined;
121
+ variant?: string | undefined;
123
122
  } & LinkContentValue, {
124
- value: LinkContentValue;
125
123
  text?: string | undefined;
126
124
  variant?: string | undefined;
125
+ value: LinkContentValue;
127
126
  }>>;
128
127
  }, z.core.$strip>>;
129
128
  }, z.core.$strip>, z.ZodMiniObject<{
@@ -273,12 +272,12 @@ declare const CompositeSliceItemContentSchema: z.ZodMiniObject<{
273
272
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
274
273
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
275
274
  }, z.core.$strip>>, z.ZodMiniTransform<{
276
- variant?: string | undefined;
277
275
  text?: string | undefined;
276
+ variant?: string | undefined;
278
277
  } & LinkContentValue, {
279
- value: LinkContentValue;
280
278
  text?: string | undefined;
281
279
  variant?: string | undefined;
280
+ value: LinkContentValue;
282
281
  }>>;
283
282
  }, z.core.$strip>, z.ZodMiniObject<{
284
283
  __TYPE__: z.ZodMiniLiteral<"RepeatableContent">;
@@ -295,12 +294,12 @@ declare const CompositeSliceItemContentSchema: z.ZodMiniObject<{
295
294
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
296
295
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
297
296
  }, z.core.$strip>>, z.ZodMiniTransform<{
298
- variant?: string | undefined;
299
297
  text?: string | undefined;
298
+ variant?: string | undefined;
300
299
  } & LinkContentValue, {
301
- value: LinkContentValue;
302
300
  text?: string | undefined;
303
301
  variant?: string | undefined;
302
+ value: LinkContentValue;
304
303
  }>>;
305
304
  }, z.core.$strip>>;
306
305
  }, z.core.$strip>, z.ZodMiniObject<{
@@ -450,12 +449,12 @@ declare const SharedSliceItemContentSchema: z.ZodMiniObject<{
450
449
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
451
450
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
452
451
  }, z.core.$strip>>, z.ZodMiniTransform<{
453
- variant?: string | undefined;
454
452
  text?: string | undefined;
453
+ variant?: string | undefined;
455
454
  } & LinkContentValue, {
456
- value: LinkContentValue;
457
455
  text?: string | undefined;
458
456
  variant?: string | undefined;
457
+ value: LinkContentValue;
459
458
  }>>;
460
459
  }, z.core.$strip>, z.ZodMiniObject<{
461
460
  __TYPE__: z.ZodMiniLiteral<"RepeatableContent">;
@@ -472,12 +471,12 @@ declare const SharedSliceItemContentSchema: z.ZodMiniObject<{
472
471
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
473
472
  value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
474
473
  }, z.core.$strip>>, z.ZodMiniTransform<{
475
- variant?: string | undefined;
476
474
  text?: string | undefined;
475
+ variant?: string | undefined;
477
476
  } & LinkContentValue, {
478
- value: LinkContentValue;
479
477
  text?: string | undefined;
480
478
  variant?: string | undefined;
479
+ value: LinkContentValue;
481
480
  }>>;
482
481
  }, z.core.$strip>>;
483
482
  }, z.core.$strip>, z.ZodMiniObject<{
@@ -554,5 +553,5 @@ declare const SlicesContentSchema: z.ZodMiniObject<{
554
553
  }, z.core.$strip>;
555
554
  type SlicesContent = z.infer<typeof SlicesContentSchema>;
556
555
  //#endregion
557
- export { CompositeSliceItemContent, LegacySliceItemContent, SharedSliceItemContent, SliceItemContent, SlicesContent };
556
+ export { CompositeSliceItemContent, CompositeSliceItemContentSchema, LegacySliceItemContent, LegacySliceItemContentSchema, SharedSliceItemContent, SharedSliceItemContentSchema, SliceItemContent, SliceItemContentSchema, SlicesContent, SlicesContentSchema };
558
557
  //# sourceMappingURL=slices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slices.d.ts","names":[],"sources":["../../src/content/slices.ts"],"mappings":";;;;;;;cA2Ba,4BAAA,EAA4B,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAE7B,yBAAyB,EAAE,aAAa;cAEvC,iCAA+B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIhC,4BAA4B,EAAE,aAAa;cAE1C,8BAA4B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAE7B,yBAAyB,EAAE,aAAa;cAGvC,wBAAsB,EAAA;;;;;;KAEvB,mBAAmB,EAAE,aAAa;cAOjC,qBAAmB,EAAA;;;;;;;;;KAKpB,gBAAgB,EAAE,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"slices.js","names":[],"sources":["../../src/content/slices.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport {\n\tCompositeSliceContentSchema,\n\tSharedSliceContentSchema,\n\tLegacySliceContentSchema,\n\tSliceContentSchema,\n} from \"./slice\"\n\n// Item\nconst getSliceItemContentSchema = <\n\tTWidgetSchema extends\n\t\t| typeof LegacySliceContentSchema\n\t\t| typeof CompositeSliceContentSchema\n\t\t| typeof SharedSliceContentSchema\n\t\t| typeof SliceContentSchema,\n>(\n\twidgetSchema: TWidgetSchema,\n) => {\n\treturn z.object({\n\t\tkey: z.string(),\n\t\tname: z.string(),\n\t\tmaybeLabel: z.optional(z.string()),\n\t\twidget: widgetSchema,\n\t})\n}\n\nexport const LegacySliceItemContentSchema = getSliceItemContentSchema(LegacySliceContentSchema)\n\nexport type LegacySliceItemContent = z.infer<typeof LegacySliceItemContentSchema>\n\nexport const CompositeSliceItemContentSchema = getSliceItemContentSchema(\n\tCompositeSliceContentSchema,\n)\n\nexport type CompositeSliceItemContent = z.infer<typeof CompositeSliceItemContentSchema>\n\nexport const SharedSliceItemContentSchema = getSliceItemContentSchema(SharedSliceContentSchema)\n\nexport type SharedSliceItemContent = z.infer<typeof SharedSliceItemContentSchema>\n\n// All\nexport const SliceItemContentSchema = getSliceItemContentSchema(SliceContentSchema)\n\nexport type SliceItemContent = z.infer<typeof SliceItemContentSchema>\n\n// Slices\n\n// Typo (missing `s`) is legacy...\nexport const SlicesContentType = \"SliceContentType\" as const\n\nexport const SlicesContentSchema = z.object({\n\t__TYPE__: z.literal(SlicesContentType),\n\tvalue: z.array(SliceItemContentSchema),\n})\n\nexport type SlicesContent = z.infer<typeof SlicesContentSchema>\n"],"mappings":";;;AAUA,MAAM,6BAOL,iBACI;AACJ,QAAO,EAAE,OAAO;EACf,KAAK,EAAE,QAAQ;EACf,MAAM,EAAE,QAAQ;EAChB,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;EAClC,QAAQ;EACR,CAAC;;AAGH,MAAa,+BAA+B,0BAA0B,yBAAyB;AAI/F,MAAa,kCAAkC,0BAC9C,4BACA;AAID,MAAa,+BAA+B,0BAA0B,yBAAyB;AAK/F,MAAa,yBAAyB,0BAA0B,mBAAmB;AAOnF,MAAa,oBAAoB;AAEjC,MAAa,sBAAsB,EAAE,OAAO;CAC3C,UAAU,EAAE,QAAQ,kBAAkB;CACtC,OAAO,EAAE,MAAM,uBAAuB;CACtC,CAAC"}
1
+ {"version":3,"file":"slices.js","names":[],"sources":["../../src/content/slices.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport {\n\tCompositeSliceContentSchema,\n\tSharedSliceContentSchema,\n\tLegacySliceContentSchema,\n\tSliceContentSchema,\n} from \"./slice\"\n\n// Item\nconst getSliceItemContentSchema = <\n\tTWidgetSchema extends\n\t\t| typeof LegacySliceContentSchema\n\t\t| typeof CompositeSliceContentSchema\n\t\t| typeof SharedSliceContentSchema\n\t\t| typeof SliceContentSchema,\n>(\n\twidgetSchema: TWidgetSchema,\n) => {\n\treturn z.object({\n\t\tkey: z.string(),\n\t\tname: z.string(),\n\t\tmaybeLabel: z.optional(z.string()),\n\t\twidget: widgetSchema,\n\t})\n}\n\nexport const LegacySliceItemContentSchema = getSliceItemContentSchema(LegacySliceContentSchema)\n\nexport type LegacySliceItemContent = z.infer<typeof LegacySliceItemContentSchema>\n\nexport const CompositeSliceItemContentSchema = getSliceItemContentSchema(\n\tCompositeSliceContentSchema,\n)\n\nexport type CompositeSliceItemContent = z.infer<typeof CompositeSliceItemContentSchema>\n\nexport const SharedSliceItemContentSchema = getSliceItemContentSchema(SharedSliceContentSchema)\n\nexport type SharedSliceItemContent = z.infer<typeof SharedSliceItemContentSchema>\n\n// All\nexport const SliceItemContentSchema = getSliceItemContentSchema(SliceContentSchema)\n\nexport type SliceItemContent = z.infer<typeof SliceItemContentSchema>\n\n// Slices\n\n// Typo (missing `s`) is legacy...\nexport const SlicesContentType = \"SliceContentType\" as const\n\nexport const SlicesContentSchema = z.object({\n\t__TYPE__: z.literal(SlicesContentType),\n\tvalue: z.array(SliceItemContentSchema),\n})\n\nexport type SlicesContent = z.infer<typeof SlicesContentSchema>\n"],"mappings":";;;AAUA,MAAM,6BAOL,iBACI;CACJ,OAAO,EAAE,OAAO;EACf,KAAK,EAAE,OAAO;EACd,MAAM,EAAE,OAAO;EACf,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC;EACjC,QAAQ;CACT,CAAC;AACF;AAEA,MAAa,+BAA+B,0BAA0B,wBAAwB;AAI9F,MAAa,kCAAkC,0BAC9C,2BACD;AAIA,MAAa,+BAA+B,0BAA0B,wBAAwB;AAK9F,MAAa,yBAAyB,0BAA0B,kBAAkB;AAOlF,MAAa,oBAAoB;AAEjC,MAAa,sBAAsB,EAAE,OAAO;CAC3C,UAAU,EAAE,QAAQ,iBAAiB;CACrC,OAAO,EAAE,MAAM,sBAAsB;AACtC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { RichTextContentBlock } from "./richText.js";
2
2
  import { z } from "zod/mini";
3
-
4
3
  //#region src/content/table.d.ts
5
4
  declare const TableContentSchema: z.ZodMiniObject<{
6
5
  __TYPE__: z.ZodMiniLiteral<"TableContent">;
@@ -20,5 +19,5 @@ declare const TableContentSchema: z.ZodMiniObject<{
20
19
  }, z.core.$strip>;
21
20
  type TableContent = z.infer<typeof TableContentSchema>;
22
21
  //#endregion
23
- export { TableContent };
22
+ export { TableContent, TableContentSchema };
24
23
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","names":[],"sources":["../../src/content/table.ts"],"mappings":";;;;cAQa,kBAAA,EAAkB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;KAKnB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA"}
1
+ {"version":3,"file":"table.d.ts","names":[],"sources":["../../src/content/table.ts"],"mappings":";;;cAQa,oBAAkB,EAAA;;;;;;;;;;;;;;;;KAKnB,eAAe,EAAE,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","names":[],"sources":["../../src/content/table.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { getTableRowSchema } from \"./legacy/table\"\nimport { RichTextContentSchema } from \"./richText\"\n\nexport const TableContentType = \"TableContent\" as const\n\n// Table\nexport const TableContentSchema = z.object({\n\t__TYPE__: z.literal(TableContentType),\n\tcontent: z.array(getTableRowSchema(RichTextContentSchema)),\n})\n\nexport type TableContent = z.infer<typeof TableContentSchema>\n"],"mappings":";;;;AAKA,MAAa,mBAAmB;AAGhC,MAAa,qBAAqB,EAAE,OAAO;CAC1C,UAAU,EAAE,QAAQ,iBAAiB;CACrC,SAAS,EAAE,MAAM,kBAAkB,sBAAsB,CAAC;CAC1D,CAAC"}
1
+ {"version":3,"file":"table.js","names":[],"sources":["../../src/content/table.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { getTableRowSchema } from \"./legacy/table\"\nimport { RichTextContentSchema } from \"./richText\"\n\nexport const TableContentType = \"TableContent\" as const\n\n// Table\nexport const TableContentSchema = z.object({\n\t__TYPE__: z.literal(TableContentType),\n\tcontent: z.array(getTableRowSchema(RichTextContentSchema)),\n})\n\nexport type TableContent = z.infer<typeof TableContentSchema>\n"],"mappings":";;;;AAKA,MAAa,mBAAmB;AAGhC,MAAa,qBAAqB,EAAE,OAAO;CAC1C,UAAU,EAAE,QAAQ,gBAAgB;CACpC,SAAS,EAAE,MAAM,kBAAkB,qBAAqB,CAAC;AAC1D,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod/mini";
2
-
3
2
  //#region src/content/uid.d.ts
4
3
  declare const UIDContentSchema: z.ZodMiniObject<{
5
4
  __TYPE__: z.ZodMiniLiteral<"UIDContent">;
@@ -7,5 +6,5 @@ declare const UIDContentSchema: z.ZodMiniObject<{
7
6
  }, z.core.$strip>;
8
7
  type UIDContent = z.infer<typeof UIDContentSchema>;
9
8
  //#endregion
10
- export { UIDContent };
9
+ export { UIDContent, UIDContentSchema };
11
10
  //# sourceMappingURL=uid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uid.d.ts","names":[],"sources":["../../src/content/uid.ts"],"mappings":";;;cAIa,gBAAA,EAAgB,CAAA,CAAA,aAAA;;;;KAKjB,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA"}
1
+ {"version":3,"file":"uid.d.ts","names":[],"sources":["../../src/content/uid.ts"],"mappings":";;cAIa,kBAAgB,EAAA;;;;KAKjB,aAAa,EAAE,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"uid.js","names":[],"sources":["../../src/content/uid.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const UIDContentType = \"UIDContent\" as const\n\nexport const UIDContentSchema = z.object({\n\t__TYPE__: z.literal(UIDContentType),\n\tvalue: z.string(),\n})\n\nexport type UIDContent = z.infer<typeof UIDContentSchema>\n"],"mappings":";;AAEA,MAAa,iBAAiB;AAE9B,MAAa,mBAAmB,EAAE,OAAO;CACxC,UAAU,EAAE,QAAQ,eAAe;CACnC,OAAO,EAAE,QAAQ;CACjB,CAAC"}
1
+ {"version":3,"file":"uid.js","names":[],"sources":["../../src/content/uid.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const UIDContentType = \"UIDContent\" as const\n\nexport const UIDContentSchema = z.object({\n\t__TYPE__: z.literal(UIDContentType),\n\tvalue: z.string(),\n})\n\nexport type UIDContent = z.infer<typeof UIDContentSchema>\n"],"mappings":";;AAEA,MAAa,iBAAiB;AAE9B,MAAa,mBAAmB,EAAE,OAAO;CACxC,UAAU,EAAE,QAAQ,cAAc;CAClC,OAAO,EAAE,OAAO;AACjB,CAAC"}
@@ -3,7 +3,6 @@ import { GroupContent } from "./group.js";
3
3
  import { SlicesContent } from "./slices.js";
4
4
  import { UIDContent } from "./uid.js";
5
5
  import { z } from "zod/mini";
6
-
7
6
  //#region src/content/widget.d.ts
8
7
  type WidgetContent = GroupContent | NestableContent | UIDContent | SlicesContent;
9
8
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"widget.d.ts","names":[],"sources":["../../src/content/widget.ts"],"mappings":";;;;;;;KAkBY,aAAA,GAAgB,YAAA,GAAe,eAAA,GAAkB,UAAA,GAAa,aAAA"}
1
+ {"version":3,"file":"widget.d.ts","names":[],"sources":["../../src/content/widget.ts"],"mappings":";;;;;;KAkBY,gBAAgB,eAAe,kBAAkB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"widget.js","names":[],"sources":["../../src/content/widget.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { GroupContent } from \"./group\"\nimport { GroupContentSchema } from \"./group\"\nimport type { NestableContent } from \"./nestable\"\nimport { NestableContentSchema } from \"./nestable\"\nimport type { SlicesContent } from \"./slices\"\nimport { SlicesContentSchema } from \"./slices\"\nimport type { UIDContent } from \"./uid\"\nimport { UIDContentSchema } from \"./uid\"\n\nexport const WidgetContentSchema: z.ZodMiniType<WidgetContent> = z.discriminatedUnion(\"__TYPE__\", [\n\tGroupContentSchema,\n\tNestableContentSchema,\n\tUIDContentSchema,\n\tSlicesContentSchema,\n])\n\nexport type WidgetContent = GroupContent | NestableContent | UIDContent | SlicesContent\n\nexport type ContentType = WidgetContent[\"__TYPE__\"]\n"],"mappings":";;;;;;AAWA,MAAa,sBAAoD,EAAE,mBAAmB,YAAY;CACjG;CACA;CACA;CACA;CACA,CAAC"}
1
+ {"version":3,"file":"widget.js","names":[],"sources":["../../src/content/widget.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { GroupContent } from \"./group\"\nimport { GroupContentSchema } from \"./group\"\nimport type { NestableContent } from \"./nestable\"\nimport { NestableContentSchema } from \"./nestable\"\nimport type { SlicesContent } from \"./slices\"\nimport { SlicesContentSchema } from \"./slices\"\nimport type { UIDContent } from \"./uid\"\nimport { UIDContentSchema } from \"./uid\"\n\nexport const WidgetContentSchema: z.ZodMiniType<WidgetContent> = z.discriminatedUnion(\"__TYPE__\", [\n\tGroupContentSchema,\n\tNestableContentSchema,\n\tUIDContentSchema,\n\tSlicesContentSchema,\n])\n\nexport type WidgetContent = GroupContent | NestableContent | UIDContent | SlicesContent\n\nexport type ContentType = WidgetContent[\"__TYPE__\"]\n"],"mappings":";;;;;;AAWA,MAAa,sBAAoD,EAAE,mBAAmB,YAAY;CACjG;CACA;CACA;CACA;AACD,CAAC"}
@@ -11,5 +11,5 @@ declare function current(path: Path): Part | undefined;
11
11
  declare function append(path: string, strElement: string): string;
12
12
  declare function make(...entries: (Pick<Part, "type"> & Partial<Pick<Part, "key">>)[]): Path;
13
13
  //#endregion
14
- export { Path, contentPath_d_exports };
14
+ export { Part, Path, append, contentPath_d_exports, current, make, serialize };
15
15
  //# sourceMappingURL=contentPath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentPath.d.ts","names":[],"sources":["../../src/helpers/contentPath.ts"],"mappings":";;;KAAY,IAAA;EACX,IAAA;EAUA,GAAA;AAAA;AAAA,KAGW,IAAA,GAAO,aAAA,CAAc,IAAA;AAAA,iBAIjB,SAAA,CAAU,IAAA,EAAM,IAAA;AAAA,iBAIhB,OAAA,CAAQ,IAAA,EAAM,IAAA,GAAO,IAAA;AAAA,iBAIrB,MAAA,CAAO,IAAA,UAAc,UAAA;AAAA,iBAIrB,IAAA,CAAA,GAAQ,OAAA,GAAU,IAAA,CAAK,IAAA,YAAgB,OAAA,CAAQ,IAAA,CAAK,IAAA,eAAmB,IAAA"}
1
+ {"version":3,"file":"contentPath.d.ts","names":[],"sources":["../../src/helpers/contentPath.ts"],"mappings":";;;KAAY;EACX;EAUA;;KAGW,OAAO,cAAc;iBAIjB,UAAU,MAAM;iBAIhB,QAAQ,MAAM,OAAO;iBAIrB,OAAO,cAAc;iBAIrB,QAAQ,UAAU,KAAK,gBAAgB,QAAQ,KAAK,mBAAmB"}
@@ -25,6 +25,6 @@ function make(...entries) {
25
25
  }, []);
26
26
  }
27
27
  //#endregion
28
- export { append, contentPath_exports, make, serialize };
28
+ export { append, contentPath_exports, current, make, serialize };
29
29
 
30
30
  //# sourceMappingURL=contentPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentPath.js","names":[],"sources":["../../src/helpers/contentPath.ts"],"sourcesContent":["export type Part = {\n\ttype:\n\t\t| \"CustomType\"\n\t\t| \"Widget\"\n\t\t| \"SharedSlice\"\n\t\t| \"Slice\"\n\t\t| \"LegacySlice\"\n\t\t| \"GroupItem\"\n\t\t| \"primary\"\n\t\t| \"items\"\n\t\t| \"RepeatableItem\"\n\tkey: string\n}\n\nexport type Path = ReadonlyArray<Part>\n\nconst PATH_SEPARATOR = \"::\"\n\nexport function serialize(path: Path): string {\n\treturn path.map((part) => part.key).join(PATH_SEPARATOR)\n}\n\nexport function current(path: Path): Part | undefined {\n\treturn path[path.length - 1]\n}\n\nexport function append(path: string, strElement: string): string {\n\treturn path + PATH_SEPARATOR + strElement\n}\n\nexport function make(...entries: (Pick<Part, \"type\"> & Partial<Pick<Part, \"key\">>)[]): Path {\n\treturn entries.reduce<Path>((acc, { key, type }) => {\n\t\treturn key ? acc.concat({ key, type }) : acc\n\t}, [])\n}\n"],"mappings":";;;;;;;;AAgBA,MAAM,iBAAiB;AAEvB,SAAgB,UAAU,MAAoB;AAC7C,QAAO,KAAK,KAAK,SAAS,KAAK,IAAI,CAAC,KAAK,eAAe;;AAGzD,SAAgB,QAAQ,MAA8B;AACrD,QAAO,KAAK,KAAK,SAAS;;AAG3B,SAAgB,OAAO,MAAc,YAA4B;AAChE,QAAO,OAAO,iBAAiB;;AAGhC,SAAgB,KAAK,GAAG,SAAoE;AAC3F,QAAO,QAAQ,QAAc,KAAK,EAAE,KAAK,WAAW;AACnD,SAAO,MAAM,IAAI,OAAO;GAAE;GAAK;GAAM,CAAC,GAAG;IACvC,EAAE,CAAC"}
1
+ {"version":3,"file":"contentPath.js","names":[],"sources":["../../src/helpers/contentPath.ts"],"sourcesContent":["export type Part = {\n\ttype:\n\t\t| \"CustomType\"\n\t\t| \"Widget\"\n\t\t| \"SharedSlice\"\n\t\t| \"Slice\"\n\t\t| \"LegacySlice\"\n\t\t| \"GroupItem\"\n\t\t| \"primary\"\n\t\t| \"items\"\n\t\t| \"RepeatableItem\"\n\tkey: string\n}\n\nexport type Path = ReadonlyArray<Part>\n\nconst PATH_SEPARATOR = \"::\"\n\nexport function serialize(path: Path): string {\n\treturn path.map((part) => part.key).join(PATH_SEPARATOR)\n}\n\nexport function current(path: Path): Part | undefined {\n\treturn path[path.length - 1]\n}\n\nexport function append(path: string, strElement: string): string {\n\treturn path + PATH_SEPARATOR + strElement\n}\n\nexport function make(...entries: (Pick<Part, \"type\"> & Partial<Pick<Part, \"key\">>)[]): Path {\n\treturn entries.reduce<Path>((acc, { key, type }) => {\n\t\treturn key ? acc.concat({ key, type }) : acc\n\t}, [])\n}\n"],"mappings":";;;;;;;;AAgBA,MAAM,iBAAiB;AAEvB,SAAgB,UAAU,MAAoB;CAC7C,OAAO,KAAK,KAAK,SAAS,KAAK,GAAG,CAAC,CAAC,KAAK,cAAc;AACxD;AAEA,SAAgB,QAAQ,MAA8B;CACrD,OAAO,KAAK,KAAK,SAAS;AAC3B;AAEA,SAAgB,OAAO,MAAc,YAA4B;CAChE,OAAO,OAAO,iBAAiB;AAChC;AAEA,SAAgB,KAAK,GAAG,SAAoE;CAC3F,OAAO,QAAQ,QAAc,KAAK,EAAE,KAAK,WAAW;EACnD,OAAO,MAAM,IAAI,OAAO;GAAE;GAAK;EAAK,CAAC,IAAI;CAC1C,GAAG,CAAC,CAAC;AACN"}
@@ -1,7 +1,5 @@
1
1
  import { SharedSliceModel } from "../model/slice.js";
2
2
  import { DynamicCustomTypeModel, DynamicCustomTypeModelTab, StaticCustomTypeModel, StaticCustomTypeModelTab } from "../model/customType.js";
3
-
4
- //#region src/helpers/customTypeModel.d.ts
5
3
  declare namespace customTypeModel_d_exports {
6
4
  export { collectSharedSlices, filterMissingSharedSlices, flatten, serializeID, toDynamic, toStatic };
7
5
  }
@@ -13,5 +11,5 @@ declare function collectSharedSlices(customType: StaticCustomTypeModel): Record<
13
11
  declare function filterMissingSharedSlices<TCustomType extends StaticCustomTypeModel | DynamicCustomTypeModel>(customType: TCustomType, sharedSlices: Map<string, SharedSliceModel> | Record<string, SharedSliceModel>): TCustomType;
14
12
  declare function serializeID(input: string): string;
15
13
  //#endregion
16
- export { customTypeModel_d_exports };
14
+ export { collectSharedSlices, customTypeModel_d_exports, filterMissingSharedSlices, flatten, serializeID, toDynamic, toStatic };
17
15
  //# sourceMappingURL=customTypeModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customTypeModel.d.ts","names":[],"sources":["../../src/helpers/customTypeModel.ts"],"mappings":";;;;;;;iBAQgB,QAAA,CACf,UAAA,EAAY,sBAAA,EACZ,YAAA,EAAc,GAAA,SAAY,gBAAA,IAAoB,MAAA,SAAe,gBAAA,IAC3D,qBAAA;AAAA,iBAwCa,SAAA,CAAU,UAAA,EAAY,qBAAA,GAAwB,sBAAA;AAAA,iBAkC9C,OAAA,CAAQ,UAAA,EAAY,qBAAA,GAAwB,wBAAA;AAAA,iBAC5C,OAAA,CAAQ,UAAA,EAAY,sBAAA,GAAyB,yBAAA;AAAA,iBAK7C,mBAAA,CACf,UAAA,EAAY,qBAAA,GACV,MAAA,SAAe,gBAAA;AAAA,iBAiBF,yBAAA,qBACK,qBAAA,GAAwB,sBAAA,CAAA,CAE5C,UAAA,EAAY,WAAA,EACZ,YAAA,EAAc,GAAA,SAAY,gBAAA,IAAoB,MAAA,SAAe,gBAAA,IAC3D,WAAA;AAAA,iBAuCa,WAAA,CAAY,KAAA"}
1
+ {"version":3,"file":"customTypeModel.d.ts","names":[],"sources":["../../src/helpers/customTypeModel.ts"],"mappings":";;;;;iBAQgB,SACf,YAAY,wBACZ,cAAc,YAAY,oBAAoB,eAAe,oBAC3D;iBAwCa,UAAU,YAAY,wBAAwB;iBAkC9C,QAAQ,YAAY,wBAAwB;iBAC5C,QAAQ,YAAY,yBAAyB;iBAO7C,oBACf,YAAY,wBACV,eAAe;iBAiBF,0BACf,oBAAoB,wBAAwB,wBAE5C,YAAY,aACZ,cAAc,YAAY,oBAAoB,eAAe,oBAC3D;iBAuCa,YAAY"}
@@ -114,6 +114,6 @@ function serializeID(input) {
114
114
  return normalized;
115
115
  }
116
116
  //#endregion
117
- export { collectSharedSlices, customTypeModel_exports, flatten };
117
+ export { collectSharedSlices, customTypeModel_exports, filterMissingSharedSlices, flatten, serializeID, toDynamic, toStatic };
118
118
 
119
119
  //# sourceMappingURL=customTypeModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customTypeModel.js","names":[],"sources":["../../src/helpers/customTypeModel.ts"],"sourcesContent":["import type {\n\tDynamicCustomTypeModel,\n\tDynamicCustomTypeModelTab,\n\tStaticCustomTypeModel,\n\tStaticCustomTypeModelTab,\n} from \"../model/customType\"\nimport type { DynamicSliceModel, SharedSliceModel, StaticSliceModel } from \"../model/slice\"\n\nexport function toStatic(\n\tcustomType: DynamicCustomTypeModel,\n\tsharedSlices: Map<string, SharedSliceModel> | Record<string, SharedSliceModel>,\n): StaticCustomTypeModel {\n\tconst json: StaticCustomTypeModel[\"json\"] = {}\n\n\tconst sharedSlicesMap =\n\t\tsharedSlices instanceof Map ? sharedSlices : new Map(Object.entries(sharedSlices))\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: StaticCustomTypeModel[\"json\"][string] = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Record<string, StaticSliceModel> = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tconst sharedSlice = sharedSlicesMap.get(id)\n\t\t\t\t\t\t\tif (sharedSlice) {\n\t\t\t\t\t\t\t\tchoices[id] = sharedSlice\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function toDynamic(customType: StaticCustomTypeModel): DynamicCustomTypeModel {\n\tconst json: DynamicCustomTypeModel[\"json\"] = {}\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: DynamicCustomTypeModel[\"json\"][string] = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Record<string, DynamicSliceModel> = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tchoices[id] = { type: \"SharedSlice\" }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function flatten(customType: StaticCustomTypeModel): StaticCustomTypeModelTab\nexport function flatten(customType: DynamicCustomTypeModel): DynamicCustomTypeModelTab\nexport function flatten(customType: StaticCustomTypeModel | DynamicCustomTypeModel): StaticCustomTypeModelTab | DynamicCustomTypeModelTab {\n\treturn Object.values(customType.json).reduce((acc, fields) => ({ ...acc, ...fields }), {})\n}\n\nexport function collectSharedSlices(\n\tcustomType: StaticCustomTypeModel,\n): Record<string, SharedSliceModel> {\n\tconst sharedSlices: Record<string, SharedSliceModel> = {}\n\n\tconst flattened = flatten(customType)\n\tfor (const widget of Object.values(flattened)) {\n\t\tif (widget.type === \"Slices\" || widget.type === \"Choice\") {\n\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\tsharedSlices[id] = model\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn sharedSlices\n}\n\nexport function filterMissingSharedSlices<\n\tTCustomType extends StaticCustomTypeModel | DynamicCustomTypeModel,\n>(\n\tcustomType: TCustomType,\n\tsharedSlices: Map<string, SharedSliceModel> | Record<string, SharedSliceModel>,\n): TCustomType {\n\tconst json: TCustomType[\"json\"] = {}\n\n\tconst sharedSlicesMap =\n\t\tsharedSlices instanceof Map ? sharedSlices : new Map(Object.entries(sharedSlices))\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: typeof tab = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Required<typeof widget>[\"config\"][\"choices\"] = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tif (sharedSlicesMap.get(id)) {\n\t\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function serializeID(input: string): string {\n\tconst normalized = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, \"_\")\n\t\t.replace(/^_+|_+$/g, \"\")\n\n\tif (normalized.length === 0) {\n\t\tthrow new Error(`Cannot serialize \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SAAQ,OAAO;;AAIlB,OAAK,UAAU;;AAGhB,QAAO;EAAE,GAAG;EAAY;EAAM;;AAG/B,SAAgB,YAAY,OAAuB;CAClD,MAAM,aAAa,MACjB,MAAM,CACN,UAAU,MAAM,CAChB,QAAQ,WAAW,GAAG,CACtB,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG;AAEzB,KAAI,WAAW,WAAW,EACzB,OAAM,IAAI,MAAM,qBAAqB,MAAM,qBAAqB;AAGjE,QAAO"}
1
+ {"version":3,"file":"customTypeModel.js","names":[],"sources":["../../src/helpers/customTypeModel.ts"],"sourcesContent":["import type {\n\tDynamicCustomTypeModel,\n\tDynamicCustomTypeModelTab,\n\tStaticCustomTypeModel,\n\tStaticCustomTypeModelTab,\n} from \"../model/customType\"\nimport type { DynamicSliceModel, SharedSliceModel, StaticSliceModel } from \"../model/slice\"\n\nexport function toStatic(\n\tcustomType: DynamicCustomTypeModel,\n\tsharedSlices: Map<string, SharedSliceModel> | Record<string, SharedSliceModel>,\n): StaticCustomTypeModel {\n\tconst json: StaticCustomTypeModel[\"json\"] = {}\n\n\tconst sharedSlicesMap =\n\t\tsharedSlices instanceof Map ? sharedSlices : new Map(Object.entries(sharedSlices))\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: StaticCustomTypeModel[\"json\"][string] = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Record<string, StaticSliceModel> = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tconst sharedSlice = sharedSlicesMap.get(id)\n\t\t\t\t\t\t\tif (sharedSlice) {\n\t\t\t\t\t\t\t\tchoices[id] = sharedSlice\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function toDynamic(customType: StaticCustomTypeModel): DynamicCustomTypeModel {\n\tconst json: DynamicCustomTypeModel[\"json\"] = {}\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: DynamicCustomTypeModel[\"json\"][string] = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Record<string, DynamicSliceModel> = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tchoices[id] = { type: \"SharedSlice\" }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function flatten(customType: StaticCustomTypeModel): StaticCustomTypeModelTab\nexport function flatten(customType: DynamicCustomTypeModel): DynamicCustomTypeModelTab\nexport function flatten(\n\tcustomType: StaticCustomTypeModel | DynamicCustomTypeModel,\n): StaticCustomTypeModelTab | DynamicCustomTypeModelTab {\n\treturn Object.values(customType.json).reduce((acc, fields) => ({ ...acc, ...fields }), {})\n}\n\nexport function collectSharedSlices(\n\tcustomType: StaticCustomTypeModel,\n): Record<string, SharedSliceModel> {\n\tconst sharedSlices: Record<string, SharedSliceModel> = {}\n\n\tconst flattened = flatten(customType)\n\tfor (const widget of Object.values(flattened)) {\n\t\tif (widget.type === \"Slices\" || widget.type === \"Choice\") {\n\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\tsharedSlices[id] = model\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn sharedSlices\n}\n\nexport function filterMissingSharedSlices<\n\tTCustomType extends StaticCustomTypeModel | DynamicCustomTypeModel,\n>(\n\tcustomType: TCustomType,\n\tsharedSlices: Map<string, SharedSliceModel> | Record<string, SharedSliceModel>,\n): TCustomType {\n\tconst json: TCustomType[\"json\"] = {}\n\n\tconst sharedSlicesMap =\n\t\tsharedSlices instanceof Map ? sharedSlices : new Map(Object.entries(sharedSlices))\n\n\tfor (const [tabKey, tab] of Object.entries(customType.json)) {\n\t\tconst tabJSON: typeof tab = {}\n\t\tfor (const [key, widget] of Object.entries(tab)) {\n\t\t\tswitch (widget.type) {\n\t\t\t\tcase \"Slices\":\n\t\t\t\tcase \"Choice\":\n\t\t\t\t\tconst choices: Required<typeof widget>[\"config\"][\"choices\"] = {}\n\t\t\t\t\tfor (const [id, model] of Object.entries(widget.config?.choices || {})) {\n\t\t\t\t\t\tif (model.type === \"SharedSlice\") {\n\t\t\t\t\t\t\tif (sharedSlicesMap.get(id)) {\n\t\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchoices[id] = model\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttabJSON[key] = {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tconfig: { ...widget.config, choices },\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\ttabJSON[key] = widget\n\t\t\t}\n\t\t}\n\n\t\tjson[tabKey] = tabJSON\n\t}\n\n\treturn { ...customType, json }\n}\n\nexport function serializeID(input: string): string {\n\tconst normalized = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, \"_\")\n\t\t.replace(/^_+|_+$/g, \"\")\n\n\tif (normalized.length === 0) {\n\t\tthrow new Error(`Cannot serialize \"${input}\": result is empty.`)\n\t}\n\n\treturn normalized\n}\n"],"mappings":";;;;;;;;;;AAQA,SAAgB,SACf,YACA,cACwB;CACxB,MAAM,OAAsC,CAAC;CAE7C,MAAM,kBACL,wBAAwB,MAAM,eAAe,IAAI,IAAI,OAAO,QAAQ,YAAY,CAAC;CAElF,KAAK,MAAM,CAAC,QAAQ,QAAQ,OAAO,QAAQ,WAAW,IAAI,GAAG;EAC5D,MAAM,UAAiD,CAAC;EACxD,KAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,GAAG,GAC7C,QAAQ,OAAO,MAAf;GACC,KAAK;GACL,KAAK;IACJ,MAAM,UAA4C,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,UAAU,OAAO,QAAQ,OAAO,QAAQ,WAAW,CAAC,CAAC,GACpE,IAAI,MAAM,SAAS,eAAe;KACjC,MAAM,cAAc,gBAAgB,IAAI,EAAE;KAC1C,IAAI,aACH,QAAQ,MAAM;IAEhB,OACC,QAAQ,MAAM;IAIhB,QAAQ,OAAO;KACd,GAAG;KACH,QAAQ;MAAE,GAAG,OAAO;MAAQ;KAAQ;IACrC;IACA;GACD,SACC,QAAQ,OAAO;EACjB;EAGD,KAAK,UAAU;CAChB;CAEA,OAAO;EAAE,GAAG;EAAY;CAAK;AAC9B;AAEA,SAAgB,UAAU,Y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O,QAAQ,WAAW,IAAI,GAAG;EAC5D,MAAM,UAAsB,CAAC;EAC7B,KAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,GAAG,GAC7C,QAAQ,OAAO,MAAf;GACC,KAAK;GACL,KAAK;IACJ,MAAM,UAAwD,CAAC;IAC/D,KAAK,MAAM,CAAC,IAAI,UAAU,OAAO,QAAQ,OAAO,QAAQ,WAAW,CAAC,CAAC,GACpE,IAAI,MAAM,SAAS;SACd,gBAAgB,IAAI,EAAE,GACzB,QAAQ,MAAM;IAAA,OAGf,QAAQ,MAAM;IAIhB,QAAQ,OAAO;KACd,GAAG;KACH,QAAQ;MAAE,GAAG,OAAO;MAAQ;KAAQ;IACrC;IACA;GACD,SACC,QAAQ,OAAO;EACjB;EAGD,KAAK,UAAU;CAChB;CAEA,OAAO;EAAE,GAAG;EAAY;CAAK;AAC9B;AAEA,SAAgB,YAAY,OAAuB;CAClD,MAAM,aAAa,MACjB,KAAK,CAAC,CACN,UAAU,KAAK,CAAC,CAChB,QAAQ,WAAW,EAAE,CAAC,CACtB,YAAY,CAAC,CACb,QAAQ,eAAe,GAAG,CAAC,CAC3B,QAAQ,YAAY,EAAE;CAExB,IAAI,WAAW,WAAW,GACzB,MAAM,IAAI,MAAM,qBAAqB,MAAM,oBAAoB;CAGhE,OAAO;AACR"}
@@ -3,8 +3,6 @@ import { DocumentContent } from "../content/document.js";
3
3
  import { StaticCustomTypeModel } from "../model/customType.js";
4
4
  import { Path } from "./contentPath.js";
5
5
  import { DocumentLegacy } from "../content/legacy/document.js";
6
-
7
- //#region src/helpers/documentContent.d.ts
8
6
  declare namespace documentContent_d_exports {
9
7
  export { collectWidgets, fromLegacy, serializeUID, toLegacy };
10
8
  }
@@ -17,5 +15,5 @@ declare function fromLegacy(legacy: DocumentLegacy, model: StaticCustomTypeModel
17
15
  declare function toLegacy(document: DocumentContent): DocumentLegacy;
18
16
  declare function serializeUID(input: string): string;
19
17
  //#endregion
20
- export { documentContent_d_exports };
18
+ export { collectWidgets, documentContent_d_exports, fromLegacy, serializeUID, toLegacy };
21
19
  //# sourceMappingURL=documentContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentContent.d.ts","names":[],"sources":["../../src/helpers/documentContent.ts"],"mappings":";;;;;;;;;;iBAkBgB,cAAA,wBAAsC,aAAA,CAAA,CACrD,QAAA,EAAU,eAAA,EACV,IAAA,GACC,OAAA,EAAS,aAAA,EACT,IAAA;EACC,IAAA,EAAM,IAAA;EACN,GAAA;EACA,KAAA;AAAA,MAEG,OAAA,IAAW,cAAA,GACd,MAAA,SAAe,cAAA;AAAA,iBAgBF,UAAA,CACf,MAAA,EAAQ,cAAA,EACR,KAAA,EAAO,qBAAA,GACL,eAAA;AAAA,iBAwDa,QAAA,CAAS,QAAA,EAAU,eAAA,GAAkB,cAAA;AAAA,iBAMrC,YAAA,CAAa,KAAA"}
1
+ {"version":3,"file":"documentContent.d.ts","names":[],"sources":["../../src/helpers/documentContent.ts"],"mappings":";;;;;;;;iBAkBgB,eAAe,uBAAuB,eACrD,UAAU,iBACV,OACC,SAAS,eACT;EACC,MAAM;EACN;EACA;MAEG,WAAW,iBACd,eAAe;iBAgBF,WACf,QAAQ,gBACR,OAAO,wBACL;iBAwDa,SAAS,UAAU,kBAAkB;iBAMrC,aAAa"}
@@ -63,6 +63,6 @@ function serializeUID(input) {
63
63
  return input.replace(/ /g, "-").normalize("NFD").replace(/\p{M}/gu, "").replace(/[^\p{L}\d_.-]/gu, "").toLowerCase();
64
64
  }
65
65
  //#endregion
66
- export { documentContent_exports };
66
+ export { collectWidgets, documentContent_exports, fromLegacy, serializeUID, toLegacy };
67
67
 
68
68
  //# sourceMappingURL=documentContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentContent.js","names":["contentPath.serialize","customTypeModel.collectSharedSlices","sliceContent.compositeToShared","sliceContent.legacyToShared"],"sources":["../../src/helpers/documentContent.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { DocumentLegacyCodec } from \"../content/codec/document\"\nimport { defaultCtx } from \"../content/codec/legacyContentCtx\"\nimport type { DocumentContent } from \"../content/document\"\nimport type { DocumentLegacy } from \"../content/legacy/document\"\nimport { DocumentLegacySchema } from \"../content/legacy/document\"\nimport { isNestableContent } from \"../content/nestable\"\nimport type { CompositeSliceItemContent, LegacySliceItemContent } from \"../content/slices\"\nimport type { WidgetContent } from \"../content/widget\"\nimport type { StaticCustomTypeModel } from \"../model/customType\"\nimport type { FieldOrSliceType } from \"../model/widget\"\nimport { FieldOrSliceTypeSchema } from \"../model/widget\"\nimport * as contentPath from \"./contentPath\"\nimport * as customTypeModel from \"./customTypeModel\"\nimport * as sliceContent from \"./sliceContent\"\nimport { traverseDocumentContent } from \"./traverseContent\"\n\nexport function collectWidgets<TWidgetContent extends WidgetContent>(\n\tdocument: DocumentContent,\n\ttest: (\n\t\tcontent: WidgetContent,\n\t\targs: {\n\t\t\tpath: contentPath.Path\n\t\t\tkey: string\n\t\t\tapiID: string\n\t\t},\n\t) => content is TWidgetContent,\n): Record<string, TWidgetContent> {\n\tconst collected: Record<string, TWidgetContent> = {}\n\n\ttraverseDocumentContent(document, {\n\t\ttransformWidget: ({ content, ...args }) => {\n\t\t\tif (test(content, args)) {\n\t\t\t\tcollected[contentPath.serialize(args.path)] = content\n\t\t\t}\n\n\t\t\treturn content\n\t\t},\n\t})\n\n\treturn collected\n}\n\nexport function fromLegacy(\n\tlegacy: DocumentLegacy,\n\tmodel: StaticCustomTypeModel,\n): DocumentContent | undefined {\n\tconst parsed = DocumentLegacySchema.safeParse(legacy)\n\tif (!parsed.success) {\n\t\treturn\n\t}\n\n\tconst types = new Map<string, FieldOrSliceType>()\n\tconst keys = new Map<string, string>()\n\tconst widgets: DocumentLegacy = {}\n\tfor (const [key, value] of Object.entries(parsed.data)) {\n\t\tif (key.endsWith(\"_TYPE\")) {\n\t\t\tconst parsed = FieldOrSliceTypeSchema.safeParse(value)\n\t\t\tif (parsed.success) {\n\t\t\t\ttypes.set(key.substring(0, key.length - 5), parsed.data)\n\t\t\t}\n\t\t} else if (key.endsWith(\"_KEY\")) {\n\t\t\tconst parsed = z.uuidv4().safeParse(value)\n\t\t\tif (parsed.success) {\n\t\t\t\tkeys.set(key.substring(0, key.length - 4), parsed.data)\n\t\t\t}\n\t\t} else if (!key.endsWith(\"_POSITION\")) {\n\t\t\twidgets[key] = value\n\t\t}\n\t}\n\n\tconst result = DocumentLegacyCodec(defaultCtx(\"\", types, keys)).toContent(widgets)\n\tif (!result.success) {\n\t\treturn\n\t}\n\n\tconst needsMigration = Object.values(customTypeModel.collectSharedSlices(model)).some((slice) =>\n\t\tBoolean(slice.legacyPaths),\n\t)\n\n\tif (needsMigration) {\n\t\treturn traverseDocumentContent(result.data, {\n\t\t\tmodel,\n\t\t\ttransformSlice: ({ content, model }) => {\n\t\t\t\tif (model?.type === \"SharedSlice\") {\n\t\t\t\t\tif (content.widget.__TYPE__ === \"CompositeSliceContent\") {\n\t\t\t\t\t\treturn sliceContent.compositeToShared(content as CompositeSliceItemContent, model)\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tcontent.widget.__TYPE__ === \"GroupContentType\" ||\n\t\t\t\t\t\tisNestableContent(content.widget)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn sliceContent.legacyToShared(content as LegacySliceItemContent, model)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn content\n\t\t\t},\n\t\t})\n\t}\n\n\treturn result.data\n}\n\nexport function toLegacy(document: DocumentContent): DocumentLegacy {\n\tconst { content, types, keys } = DocumentLegacyCodec(defaultCtx(\"\")).fromContent(document)\n\n\treturn { ...content, ...types, ...keys }\n}\n\nexport function serializeUID(input: string): string {\n\tconst nowhitespace = input.replace(/ /g, \"-\")\n\n\tconst normalized = nowhitespace.normalize(\"NFD\").replace(/\\p{M}/gu, \"\")\n\n\tconst slug = normalized.replace(/[^\\p{L}\\d_.-]/gu, \"\")\n\n\treturn slug.toLowerCase()\n}\n"],"mappings":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MAAM;aAElF,QAAQ,OAAO,aAAa,sBAC5B,kBAAkB,QAAQ,OAAO,CAEjC,QAAOC,eAA4B,SAAmC,MAAM;;AAG9E,UAAO;;EAER,CAAC;AAGH,QAAO,OAAO;;AAGf,SAAgB,SAAS,UAA2C;CACnE,MAAM,EAAE,SAAS,OAAO,SAAS,oBAAoB,WAAW,GAAG,CAAC,CAAC,YAAY,SAAS;AAE1F,QAAO;EAAE,GAAG;EAAS,GAAG;EAAO,GAAG;EAAM;;AAGzC,SAAgB,aAAa,OAAuB;AAOnD,QANqB,MAAM,QAAQ,MAAM,IAAI,CAEb,UAAU,MAAM,CAAC,QAAQ,WAAW,GAAG,CAE/C,QAAQ,mBAAmB,GAAG,CAE1C,aAAa"}
1
+ {"version":3,"file":"documentContent.js","names":["contentPath.serialize","customTypeModel.collectSharedSlices","sliceContent.compositeToShared","sliceContent.legacyToShared"],"sources":["../../src/helpers/documentContent.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { DocumentLegacyCodec } from \"../content/codec/document\"\nimport { defaultCtx } from \"../content/codec/legacyContentCtx\"\nimport type { DocumentContent } from \"../content/document\"\nimport type { DocumentLegacy } from \"../content/legacy/document\"\nimport { DocumentLegacySchema } from \"../content/legacy/document\"\nimport { isNestableContent } from \"../content/nestable\"\nimport type { CompositeSliceItemContent, LegacySliceItemContent } from \"../content/slices\"\nimport type { WidgetContent } from \"../content/widget\"\nimport type { StaticCustomTypeModel } from \"../model/customType\"\nimport type { FieldOrSliceType } from \"../model/widget\"\nimport { FieldOrSliceTypeSchema } from \"../model/widget\"\nimport * as contentPath from \"./contentPath\"\nimport * as customTypeModel from \"./customTypeModel\"\nimport * as sliceContent from \"./sliceContent\"\nimport { traverseDocumentContent } from \"./traverseContent\"\n\nexport function collectWidgets<TWidgetContent extends WidgetContent>(\n\tdocument: DocumentContent,\n\ttest: (\n\t\tcontent: WidgetContent,\n\t\targs: {\n\t\t\tpath: contentPath.Path\n\t\t\tkey: string\n\t\t\tapiID: string\n\t\t},\n\t) => content is TWidgetContent,\n): Record<string, TWidgetContent> {\n\tconst collected: Record<string, TWidgetContent> = {}\n\n\ttraverseDocumentContent(document, {\n\t\ttransformWidget: ({ content, ...args }) => {\n\t\t\tif (test(content, args)) {\n\t\t\t\tcollected[contentPath.serialize(args.path)] = content\n\t\t\t}\n\n\t\t\treturn content\n\t\t},\n\t})\n\n\treturn collected\n}\n\nexport function fromLegacy(\n\tlegacy: DocumentLegacy,\n\tmodel: StaticCustomTypeModel,\n): DocumentContent | undefined {\n\tconst parsed = DocumentLegacySchema.safeParse(legacy)\n\tif (!parsed.success) {\n\t\treturn\n\t}\n\n\tconst types = new Map<string, FieldOrSliceType>()\n\tconst keys = new Map<string, string>()\n\tconst widgets: DocumentLegacy = {}\n\tfor (const [key, value] of Object.entries(parsed.data)) {\n\t\tif (key.endsWith(\"_TYPE\")) {\n\t\t\tconst parsed = FieldOrSliceTypeSchema.safeParse(value)\n\t\t\tif (parsed.success) {\n\t\t\t\ttypes.set(key.substring(0, key.length - 5), parsed.data)\n\t\t\t}\n\t\t} else if (key.endsWith(\"_KEY\")) {\n\t\t\tconst parsed = z.uuidv4().safeParse(value)\n\t\t\tif (parsed.success) {\n\t\t\t\tkeys.set(key.substring(0, key.length - 4), parsed.data)\n\t\t\t}\n\t\t} else if (!key.endsWith(\"_POSITION\")) {\n\t\t\twidgets[key] = value\n\t\t}\n\t}\n\n\tconst result = DocumentLegacyCodec(defaultCtx(\"\", types, keys)).toContent(widgets)\n\tif (!result.success) {\n\t\treturn\n\t}\n\n\tconst needsMigration = Object.values(customTypeModel.collectSharedSlices(model)).some((slice) =>\n\t\tBoolean(slice.legacyPaths),\n\t)\n\n\tif (needsMigration) {\n\t\treturn traverseDocumentContent(result.data, {\n\t\t\tmodel,\n\t\t\ttransformSlice: ({ content, model }) => {\n\t\t\t\tif (model?.type === \"SharedSlice\") {\n\t\t\t\t\tif (content.widget.__TYPE__ === \"CompositeSliceContent\") {\n\t\t\t\t\t\treturn sliceContent.compositeToShared(content as CompositeSliceItemContent, model)\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tcontent.widget.__TYPE__ === \"GroupContentType\" ||\n\t\t\t\t\t\tisNestableContent(content.widget)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn sliceContent.legacyToShared(content as LegacySliceItemContent, model)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn content\n\t\t\t},\n\t\t})\n\t}\n\n\treturn result.data\n}\n\nexport function toLegacy(document: DocumentContent): DocumentLegacy {\n\tconst { content, types, keys } = DocumentLegacyCodec(defaultCtx(\"\")).fromContent(document)\n\n\treturn { ...content, ...types, ...keys }\n}\n\nexport function serializeUID(input: string): string {\n\tconst nowhitespace = input.replace(/ /g, \"-\")\n\n\tconst normalized = nowhitespace.normalize(\"NFD\").replace(/\\p{M}/gu, \"\")\n\n\tconst slug = normalized.replace(/[^\\p{L}\\d_.-]/gu, \"\")\n\n\treturn slug.toLowerCase()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,eACf,UACA,MAQiC;CACjC,MAAM,YAA4C,CAAC;CAEnD,wBAAwB,UAAU,EACjC,kBAAkB,EAAE,SAAS,GAAG,WAAW;EAC1C,IAAI,KAAK,SAAS,IAAI,GACrB,UAAUA,UAAsB,KAAK,IAAI,KAAK;EAG/C,OAAO;CACR,EACD,CAAC;CAED,OAAO;AACR;AAEA,SAAgB,WACf,QACA,OAC8B;CAC9B,MAAM,SAAS,qBAAqB,UAAU,MAAM;CACpD,IAAI,CAAC,OAAO,SACX;CAGD,MAAM,wBAAQ,IAAI,IAA8B;CAChD,MAAM,uBAAO,IAAI,IAAoB;CACrC,MAAM,UAA0B,CAAC;CACjC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,IAAI,GACpD,IAAI,IAAI,SAAS,OAAO,GAAG;EAC1B,MAAM,SAAS,uBAAuB,UAAU,KAAK;EACrD,IAAI,OAAO,SACV,MAAM,IAA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
  declare function serializeID(input: string): string;
5
5
  //#endregion
6
- export { fieldModel_d_exports };
6
+ export { fieldModel_d_exports, serializeID };
7
7
  //# sourceMappingURL=fieldModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldModel.d.ts","names":[],"sources":["../../src/helpers/fieldModel.ts"],"mappings":";;;iBAAgB,WAAA,CAAY,KAAA"}
1
+ {"version":3,"file":"fieldModel.d.ts","names":[],"sources":["../../src/helpers/fieldModel.ts"],"mappings":";;;iBAAgB,YAAY"}
@@ -8,6 +8,6 @@ function serializeID(input) {
8
8
  return first.toLowerCase() + rest.map((token) => token.charAt(0).toUpperCase() + token.slice(1).toLowerCase()).join("");
9
9
  }
10
10
  //#endregion
11
- export { fieldModel_exports };
11
+ export { fieldModel_exports, serializeID };
12
12
 
13
13
  //# sourceMappingURL=fieldModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldModel.js","names":[],"sources":["../../src/helpers/fieldModel.ts"],"sourcesContent":["export function serializeID(input: string): string {\n\tconst tokens = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.split(/[^A-Za-z0-9]+/)\n\t\t.filter(Boolean)\n\n\tif (tokens.length === 0) {\n\t\tthrow new Error(`Cannot serialize \"${input}\": result is empty.`)\n\t}\n\n\tconst [first, ...rest] = tokens\n\treturn (\n\t\tfirst.toLowerCase() +\n\t\trest.map((token) => token.charAt(0).toUpperCase() + token.slice(1).toLowerCase()).join(\"\")\n\t)\n}\n"],"mappings":";;;AAAA,SAAgB,YAAY,OAAuB;CAClD,MAAM,SAAS,MACb,MAAM,CACN,UAAU,MAAM,CAChB,QAAQ,WAAW,GAAG,CACtB,MAAM,gBAAgB,CACtB,OAAO,QAAQ;AAEjB,KAAI,OAAO,WAAW,EACrB,OAAM,IAAI,MAAM,qBAAqB,MAAM,qBAAqB;CAGjE,MAAM,CAAC,OAAO,GAAG,QAAQ;AACzB,QACC,MAAM,aAAa,GACnB,KAAK,KAAK,UAAU,MAAM,OAAO,EAAE,CAAC,aAAa,GAAG,MAAM,MAAM,EAAE,CAAC,aAAa,CAAC,CAAC,KAAK,GAAG"}
1
+ {"version":3,"file":"fieldModel.js","names":[],"sources":["../../src/helpers/fieldModel.ts"],"sourcesContent":["export function serializeID(input: string): string {\n\tconst tokens = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.split(/[^A-Za-z0-9]+/)\n\t\t.filter(Boolean)\n\n\tif (tokens.length === 0) {\n\t\tthrow new Error(`Cannot serialize \"${input}\": result is empty.`)\n\t}\n\n\tconst [first, ...rest] = tokens\n\treturn (\n\t\tfirst.toLowerCase() +\n\t\trest.map((token) => token.charAt(0).toUpperCase() + token.slice(1).toLowerCase()).join(\"\")\n\t)\n}\n"],"mappings":";;;AAAA,SAAgB,YAAY,OAAuB;CAClD,MAAM,SAAS,MACb,KAAK,CAAC,CACN,UAAU,KAAK,CAAC,CAChB,QAAQ,WAAW,EAAE,CAAC,CACtB,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO;CAEhB,IAAI,OAAO,WAAW,GACrB,MAAM,IAAI,MAAM,qBAAqB,MAAM,oBAAoB;CAGhE,MAAM,CAAC,OAAO,GAAG,QAAQ;CACzB,OACC,MAAM,YAAY,IAClB,KAAK,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE;AAE3F"}
@@ -1,6 +1,4 @@
1
1
  import { ImageContent, ImageContentView } from "../content/image.js";
2
-
3
- //#region src/helpers/imageContent.d.ts
4
2
  declare namespace imageContent_d_exports {
5
3
  export { CroppedImage, buildCropURL, getCroppedImage };
6
4
  }
@@ -23,11 +21,9 @@ declare function buildCropURL(args: {
23
21
  origin: ImageContent["origin"];
24
22
  croppedImage: CroppedImage;
25
23
  }): string;
26
- declare function getCroppedImage({
27
- contentView
28
- }: {
24
+ declare function getCroppedImage({ contentView }: {
29
25
  contentView: ImageContentView;
30
26
  }): CroppedImage;
31
27
  //#endregion
32
- export { imageContent_d_exports };
28
+ export { CroppedImage, buildCropURL, getCroppedImage, imageContent_d_exports };
33
29
  //# sourceMappingURL=imageContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageContent.d.ts","names":[],"sources":["../../src/helpers/imageContent.ts"],"mappings":";;;;;;UAEiB,YAAA;EAChB,IAAA;;EAEA,CAAA;;EAEA,CAAA;;EAGA,SAAA;EARgB;EAUhB,UAAA;;EAGA,KAAA;EAZA;EAcA,MAAA;AAAA;AAAA,iBAGe,YAAA,CAAa,IAAA;EAC5B,MAAA,EAAQ,YAAA;EACR,YAAA,EAAc,YAAA;AAAA;AAAA,iBA2BC,eAAA,CAAA;EAAkB;AAAA;EAAiB,WAAA,EAAa,gBAAA;AAAA,IAAqB,YAAA"}
1
+ {"version":3,"file":"imageContent.d.ts","names":[],"sources":["../../src/helpers/imageContent.ts"],"mappings":";;;;UAEiB;EAChB;;EAEA;;EAEA;;EAGA;;EAEA;;EAGA;;EAEA;;iBAGe,aAAa;EAC5B,QAAQ;EACR,cAAc;;iBA2BC,kBAAkB;EAAiB,aAAa;IAAqB"}
@@ -50,6 +50,6 @@ function getCroppedImage({ contentView }) {
50
50
  };
51
51
  }
52
52
  //#endregion
53
- export { imageContent_exports };
53
+ export { buildCropURL, getCroppedImage, imageContent_exports };
54
54
 
55
55
  //# sourceMappingURL=imageContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageContent.js","names":[],"sources":["../../src/helpers/imageContent.ts"],"sourcesContent":["import type { ImageContent, ImageContentView } from \"../content/image\"\n\nexport interface CroppedImage {\n\tzoom: number\n\t/** X coordinate of the crop rect on the original image */\n\tx: number\n\t/** Y coordinate of the crop rect on the original image */\n\ty: number\n\n\t/** The width of the crop rect over the original image */\n\tcropWidth: number\n\t/** The height of the crop rect over the original image */\n\tcropHeight: number\n\n\t/** Final (user defined via W input) width of the image */\n\twidth: number\n\t/** Final (user defined via H input) height of the image */\n\theight: number\n}\n\nexport function buildCropURL(args: {\n\torigin: ImageContent[\"origin\"]\n\tcroppedImage: CroppedImage\n}): string {\n\tconst { origin, croppedImage } = args\n\tconst { x, y, width, height, cropHeight, cropWidth } = croppedImage\n\n\tconst url = new URL(origin.url)\n\n\tconst hasResize = origin.height !== height || origin.width !== width\n\n\tconst hasCrop = x !== 0 || y !== 0 || cropHeight !== origin.height || cropWidth !== origin.width\n\n\tif (hasCrop) {\n\t\tconst crop = [x, y, cropWidth, cropHeight].map(Math.round).join(\",\")\n\n\t\turl.searchParams.set(\"rect\", crop)\n\t\turl.searchParams.set(\"w\", width.toString())\n\t\turl.searchParams.set(\"h\", height.toString())\n\t}\n\n\tif (hasResize) {\n\t\turl.searchParams.set(\"w\", width.toString())\n\t\turl.searchParams.set(\"h\", height.toString())\n\t}\n\n\treturn url.toString()\n}\n\nexport function getCroppedImage({ contentView }: { contentView: ImageContentView }): CroppedImage {\n\tconst {\n\t\tedit: {\n\t\t\tcrop: { x, y },\n\t\t\tzoom,\n\t\t},\n\t\twidth,\n\t\theight,\n\t\torigin: { width: originWidth, height: originHeight },\n\t} = contentView\n\n\tlet cropWidth\n\tlet cropHeight\n\tconst originAspect = originWidth / originHeight\n\tconst cropAspect = width / height\n\tif (cropAspect >= originAspect) {\n\t\t// crop and origin image would be the same width if zoom was equal to 1\n\t\tcropWidth = originWidth / zoom\n\t\tcropHeight = cropWidth / cropAspect\n\t} else {\n\t\t// crop and origin image would be the same height if zoom was equal to 1\n\t\tcropHeight = originHeight / zoom\n\t\tcropWidth = cropHeight * cropAspect\n\t}\n\n\treturn {\n\t\tx,\n\t\ty,\n\t\twidth,\n\t\theight,\n\t\tzoom,\n\t\tcropWidth,\n\t\tcropHeight,\n\t}\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,aAAa,MAGlB;CACV,MAAM,EAAE,QAAQ,iBAAiB;CACjC,MAAM,EAAE,GAAG,GAAG,OAAO,QAAQ,YAAY,cAAc;CAEvD,MAAM,MAAM,IAAI,IAAI,OAAO,IAAI;CAE/B,MAAM,YAAY,OAAO,WAAW,UAAU,OAAO,UAAU;AAI/D,KAFgB,MAAM,KAAK,MAAM,KAAK,eAAe,OAAO,UAAU,cAAc,OAAO,OAE9E;EACZ,MAAM,OAAO;GAAC;GAAG;GAAG;GAAW;GAAW,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,IAAI;AAEpE,MAAI,aAAa,IAAI,QAAQ,KAAK;AAClC,MAAI,aAAa,IAAI,KAAK,MAAM,UAAU,CAAC;AAC3C,MAAI,aAAa,IAAI,KAAK,OAAO,UAAU,CAAC;;AAG7C,KAAI,WAAW;AACd,MAAI,aAAa,IAAI,KAAK,MAAM,UAAU,CAAC;AAC3C,MAAI,aAAa,IAAI,KAAK,OAAO,UAAU,CAAC;;AAG7C,QAAO,IAAI,UAAU;;AAGtB,SAAgB,gBAAgB,EAAE,eAAgE;CACjG,MAAM,EACL,MAAM,EACL,MAAM,EAAE,GAAG,KACX,QAED,OACA,QACA,QAAQ,EAAE,OAAO,aAAa,QAAQ,mBACnC;CAEJ,IAAI;CACJ,IAAI;CACJ,MAAM,eAAe,cAAc;CACnC,MAAM,aAAa,QAAQ;AAC3B,KAAI,cAAc,cAAc;AAE/B,cAAY,cAAc;AAC1B,eAAa,YAAY;QACnB;AAEN,eAAa,eAAe;AAC5B,cAAY,aAAa;;AAG1B,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA"}
1
+ {"version":3,"file":"imageContent.js","names":[],"sources":["../../src/helpers/imageContent.ts"],"sourcesContent":["import type { ImageContent, ImageContentView } from \"../content/image\"\n\nexport interface CroppedImage {\n\tzoom: number\n\t/** X coordinate of the crop rect on the original image */\n\tx: number\n\t/** Y coordinate of the crop rect on the original image */\n\ty: number\n\n\t/** The width of the crop rect over the original image */\n\tcropWidth: number\n\t/** The height of the crop rect over the original image */\n\tcropHeight: number\n\n\t/** Final (user defined via W input) width of the image */\n\twidth: number\n\t/** Final (user defined via H input) height of the image */\n\theight: number\n}\n\nexport function buildCropURL(args: {\n\torigin: ImageContent[\"origin\"]\n\tcroppedImage: CroppedImage\n}): string {\n\tconst { origin, croppedImage } = args\n\tconst { x, y, width, height, cropHeight, cropWidth } = croppedImage\n\n\tconst url = new URL(origin.url)\n\n\tconst hasResize = origin.height !== height || origin.width !== width\n\n\tconst hasCrop = x !== 0 || y !== 0 || cropHeight !== origin.height || cropWidth !== origin.width\n\n\tif (hasCrop) {\n\t\tconst crop = [x, y, cropWidth, cropHeight].map(Math.round).join(\",\")\n\n\t\turl.searchParams.set(\"rect\", crop)\n\t\turl.searchParams.set(\"w\", width.toString())\n\t\turl.searchParams.set(\"h\", height.toString())\n\t}\n\n\tif (hasResize) {\n\t\turl.searchParams.set(\"w\", width.toString())\n\t\turl.searchParams.set(\"h\", height.toString())\n\t}\n\n\treturn url.toString()\n}\n\nexport function getCroppedImage({ contentView }: { contentView: ImageContentView }): CroppedImage {\n\tconst {\n\t\tedit: {\n\t\t\tcrop: { x, y },\n\t\t\tzoom,\n\t\t},\n\t\twidth,\n\t\theight,\n\t\torigin: { width: originWidth, height: originHeight },\n\t} = contentView\n\n\tlet cropWidth\n\tlet cropHeight\n\tconst originAspect = originWidth / originHeight\n\tconst cropAspect = width / height\n\tif (cropAspect >= originAspect) {\n\t\t// crop and origin image would be the same width if zoom was equal to 1\n\t\tcropWidth = originWidth / zoom\n\t\tcropHeight = cropWidth / cropAspect\n\t} else {\n\t\t// crop and origin image would be the same height if zoom was equal to 1\n\t\tcropHeight = originHeight / zoom\n\t\tcropWidth = cropHeight * cropAspect\n\t}\n\n\treturn {\n\t\tx,\n\t\ty,\n\t\twidth,\n\t\theight,\n\t\tzoom,\n\t\tcropWidth,\n\t\tcropHeight,\n\t}\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,aAAa,MAGlB;CACV,MAAM,EAAE,QAAQ,iBAAiB;CACjC,MAAM,EAAE,GAAG,GAAG,OAAO,QAAQ,YAAY,cAAc;CAEvD,MAAM,MAAM,IAAI,IAAI,OAAO,GAAG;CAE9B,MAAM,YAAY,OAAO,WAAW,UAAU,OAAO,UAAU;CAI/D,IAFgB,MAAM,KAAK,MAAM,KAAK,eAAe,OAAO,UAAU,cAAc,OAAO,OAE9E;EACZ,MAAM,OAAO;GAAC;GAAG;GAAG;GAAW;EAAU,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,KAAK,GAAG;EAEnE,IAAI,aAAa,IAAI,QAAQ,IAAI;EACjC,IAAI,aAAa,IAAI,KAAK,MAAM,SAAS,CAAC;EAC1C,IAAI,aAAa,IAAI,KAAK,OAAO,SAAS,CAAC;CAC5C;CAEA,IAAI,WAAW;EACd,IAAI,aAAa,IAAI,KAAK,MAAM,SAAS,CAAC;EAC1C,IAAI,aAAa,IAAI,KAAK,OAAO,SAAS,CAAC;CAC5C;CAEA,OAAO,IAAI,SAAS;AACrB;AAEA,SAAgB,gBAAgB,EAAE,eAAgE;CACjG,MAAM,EACL,MAAM,EACL,MAAM,EAAE,GAAG,KACX,QAED,OACA,QACA,QAAQ,EAAE,OAAO,aAAa,QAAQ,mBACnC;CAEJ,IAAI;CACJ,IAAI;CACJ,MAAM,eAAe,cAAc;CACnC,MAAM,aAAa,QAAQ;CAC3B,IAAI,cAAc,cAAc;EAE/B,YAAY,cAAc;EAC1B,aAAa,YAAY;CAC1B,OAAO;EAEN,aAAa,eAAe;EAC5B,YAAY,aAAa;CAC1B;CAEA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
@@ -3,5 +3,5 @@ declare namespace repository_d_exports {
3
3
  }
4
4
  declare function serializeID(input: string): string;
5
5
  //#endregion
6
- export { repository_d_exports };
6
+ export { repository_d_exports, serializeID };
7
7
  //# sourceMappingURL=repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository.d.ts","names":[],"sources":["../../src/helpers/repository.ts"],"mappings":";;;iBAGgB,WAAA,CAAY,KAAA"}
1
+ {"version":3,"file":"repository.d.ts","names":[],"sources":["../../src/helpers/repository.ts"],"mappings":";;;iBAGgB,YAAY"}
@@ -10,6 +10,6 @@ function serializeID(input) {
10
10
  return truncated;
11
11
  }
12
12
  //#endregion
13
- export { repository_exports };
13
+ export { repository_exports, serializeID };
14
14
 
15
15
  //# sourceMappingURL=repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository.js","names":[],"sources":["../../src/helpers/repository.ts"],"sourcesContent":["const MIN_LENGTH = 4\nconst MAX_LENGTH = 63\n\nexport function serializeID(input: string): string {\n\tconst normalized = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, \"-\")\n\t\t.replace(/^-+|-+$/g, \"\")\n\n\tconst truncated =\n\t\tnormalized.length > MAX_LENGTH ? normalized.slice(0, MAX_LENGTH).replace(/-+$/, \"\") : normalized\n\n\tif (truncated.length < MIN_LENGTH) {\n\t\tthrow new Error(\n\t\t\t`Cannot serialize \"${input}\" to a repository ID: result must be between ${MIN_LENGTH} and ${MAX_LENGTH} characters.`,\n\t\t)\n\t}\n\n\treturn truncated\n}\n"],"mappings":";;;AAAA,MAAM,aAAa;AACnB,MAAM,aAAa;AAEnB,SAAgB,YAAY,OAAuB;CAClD,MAAM,aAAa,MACjB,MAAM,CACN,UAAU,MAAM,CAChB,QAAQ,WAAW,GAAG,CACtB,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG;CAEzB,MAAM,YACL,WAAW,SAAS,aAAa,WAAW,MAAM,GAAG,WAAW,CAAC,QAAQ,OAAO,GAAG,GAAG;AAEvF,KAAI,UAAU,SAAS,WACtB,OAAM,IAAI,MACT,qBAAqB,MAAM,+CAA+C,WAAW,OAAO,WAAW,cACvG;AAGF,QAAO"}
1
+ {"version":3,"file":"repository.js","names":[],"sources":["../../src/helpers/repository.ts"],"sourcesContent":["const MIN_LENGTH = 4\nconst MAX_LENGTH = 63\n\nexport function serializeID(input: string): string {\n\tconst normalized = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, \"-\")\n\t\t.replace(/^-+|-+$/g, \"\")\n\n\tconst truncated =\n\t\tnormalized.length > MAX_LENGTH ? normalized.slice(0, MAX_LENGTH).replace(/-+$/, \"\") : normalized\n\n\tif (truncated.length < MIN_LENGTH) {\n\t\tthrow new Error(\n\t\t\t`Cannot serialize \"${input}\" to a repository ID: result must be between ${MIN_LENGTH} and ${MAX_LENGTH} characters.`,\n\t\t)\n\t}\n\n\treturn truncated\n}\n"],"mappings":";;;AAAA,MAAM,aAAa;AACnB,MAAM,aAAa;AAEnB,SAAgB,YAAY,OAAuB;CAClD,MAAM,aAAa,MACjB,KAAK,CAAC,CACN,UAAU,KAAK,CAAC,CAChB,QAAQ,WAAW,EAAE,CAAC,CACtB,YAAY,CAAC,CACb,QAAQ,eAAe,GAAG,CAAC,CAC3B,QAAQ,YAAY,EAAE;CAExB,MAAM,YACL,WAAW,SAAS,aAAa,WAAW,MAAM,GAAG,UAAU,CAAC,CAAC,QAAQ,OAAO,EAAE,IAAI;CAEvF,IAAI,UAAU,SAAS,YACtB,MAAM,IAAI,MACT,qBAAqB,MAAM,+CAA+C,WAAW,OAAO,WAAW,aACxG;CAGD,OAAO;AACR"}
@@ -1,12 +1,10 @@
1
1
  import { CompositeSliceItemContent, LegacySliceItemContent, SharedSliceItemContent } from "../content/slices.js";
2
2
  import { SharedSliceVariationContentModel } from "../model/slice.js";
3
-
4
- //#region src/helpers/sliceContent.d.ts
5
3
  declare namespace sliceContent_d_exports {
6
4
  export { compositeToShared, legacyToShared };
7
5
  }
8
6
  declare const legacyToShared: (content: LegacySliceItemContent, model: SharedSliceVariationContentModel) => SharedSliceItemContent;
9
7
  declare const compositeToShared: (content: CompositeSliceItemContent, model: SharedSliceVariationContentModel) => SharedSliceItemContent;
10
8
  //#endregion
11
- export { sliceContent_d_exports };
9
+ export { compositeToShared, legacyToShared, sliceContent_d_exports };
12
10
  //# sourceMappingURL=sliceContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sliceContent.d.ts","names":[],"sources":["../../src/helpers/sliceContent.ts"],"mappings":";;;;;;;cASa,cAAA,GACZ,OAAA,EAAS,sBAAA,EACT,KAAA,EAAO,gCAAA,KACL,sBAAA;AAAA,cAoCU,iBAAA,GACZ,OAAA,EAAS,yBAAA,EACT,KAAA,EAAO,gCAAA,KACL,sBAAA"}
1
+ {"version":3,"file":"sliceContent.d.ts","names":[],"sources":["../../src/helpers/sliceContent.ts"],"mappings":";;;;;cASa,iBAAc,SACjB,wBAAsB,OACxB,qCACL;cAoCU,oBAAiB,SACpB,2BAAyB,OAC3B,qCACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"sliceContent.js","names":[],"sources":["../../src/helpers/sliceContent.ts"],"sourcesContent":["import type { GroupItemContent } from \"../content/group\"\nimport type { SharedSliceContent } from \"../content/slice\"\nimport type {\n\tCompositeSliceItemContent,\n\tLegacySliceItemContent,\n\tSharedSliceItemContent,\n} from \"../content/slices\"\nimport type { SharedSliceVariationContentModel } from \"../model/slice\"\n\nexport const legacyToShared = (\n\tcontent: LegacySliceItemContent,\n\tmodel: SharedSliceVariationContentModel,\n): SharedSliceItemContent => {\n\tconst sliceUUID = content.key.split(\"$\")[1]\n\n\tconst primary: SharedSliceContent[\"primary\"] = {}\n\tconst items: SharedSliceContent[\"items\"] = []\n\tif (content.widget.__TYPE__ === \"GroupContentType\") {\n\t\t// Group content\n\t\tfor (const item of content.widget.value) {\n\t\t\tconst value: GroupItemContent[\"value\"] = []\n\n\t\t\tfor (const [key, nestable] of item.value) {\n\t\t\t\tif (model.fields.items?.[key]) {\n\t\t\t\t\tvalue.push([key, nestable])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titems.push({ ...item, value })\n\t\t}\n\t} else if (model.fields.primary?.[content.name]) {\n\t\t// Nestable content\n\t\tprimary[content.name] = content.widget\n\t}\n\n\treturn {\n\t\tkey: `${model.sliceName}$${sliceUUID}`,\n\t\tname: model.sliceName,\n\t\tmaybeLabel: content.maybeLabel,\n\t\twidget: {\n\t\t\t__TYPE__: \"SharedSliceContent\",\n\t\t\tvariation: model.variationID,\n\t\t\tprimary,\n\t\t\titems,\n\t\t},\n\t}\n}\n\nexport const compositeToShared = (\n\tcontent: CompositeSliceItemContent,\n\tmodel: SharedSliceVariationContentModel,\n): SharedSliceItemContent => {\n\tconst sliceUUID = content.key.split(\"$\")[1]\n\n\tconst primary: SharedSliceContent[\"primary\"] = {}\n\tfor (const [key, value] of Object.entries(content.widget.nonRepeat)) {\n\t\tif (model.fields.primary?.[key]) {\n\t\t\tprimary[key] = value\n\t\t}\n\t}\n\n\tconst items: SharedSliceContent[\"items\"] = []\n\tfor (const item of content.widget.repeat) {\n\t\tconst value: GroupItemContent[\"value\"] = []\n\n\t\tfor (const [key, nestable] of item.value) {\n\t\t\tif (model.fields.items?.[key]) {\n\t\t\t\tvalue.push([key, nestable])\n\t\t\t}\n\t\t}\n\n\t\titems.push({ ...item, value })\n\t}\n\n\treturn {\n\t\tkey: `${model.sliceName}$${sliceUUID}`,\n\t\tname: model.sliceName,\n\t\tmaybeLabel: content.maybeLabel,\n\t\twidget: {\n\t\t\t__TYPE__: \"SharedSliceContent\",\n\t\t\tvariation: model.variationID,\n\t\t\tprimary,\n\t\t\titems,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;AASA,MAAa,kBACZ,SACA,UAC4B;CAC5B,MAAM,YAAY,QAAQ,IAAI,MAAM,IAAI,CAAC;CAEzC,MAAM,UAAyC,EAAE;CACjD,MAAM,QAAqC,EAAE;AAC7C,KAAI,QAAQ,OAAO,aAAa,mBAE/B,MAAK,MAAM,QAAQ,QAAQ,OAAO,OAAO;EACxC,MAAM,QAAmC,EAAE;AAE3C,OAAK,MAAM,CAAC,KAAK,aAAa,KAAK,MAClC,KAAI,MAAM,OAAO,QAAQ,KACxB,OAAM,KAAK,CAAC,KAAK,SAAS,CAAC;AAI7B,QAAM,KAAK;GAAE,GAAG;GAAM;GAAO,CAAC;;UAErB,MAAM,OAAO,UAAU,QAAQ,MAEzC,SAAQ,QAAQ,QAAQ,QAAQ;AAGjC,QAAO;EACN,KAAK,GAAG,MAAM,UAAU,GAAG;EAC3B,MAAM,MAAM;EACZ,YAAY,QAAQ;EACpB,QAAQ;GACP,UAAU;GACV,WAAW,MAAM;GACjB;GACA;GACA;EACD;;AAGF,MAAa,qBACZ,SACA,UAC4B;CAC5B,MAAM,YAAY,QAAQ,IAAI,MAAM,IAAI,CAAC;CAEzC,MAAM,UAAyC,EAAE;AACjD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,OAAO,UAAU,CAClE,KAAI,MAAM,OAAO,UAAU,KAC1B,SAAQ,OAAO;CAIjB,MAAM,QAAqC,EAAE;AAC7C,MAAK,MAAM,QAAQ,QAAQ,OAAO,QAAQ;EACzC,MAAM,QAAmC,EAAE;AAE3C,OAAK,MAAM,CAAC,KAAK,aAAa,KAAK,MAClC,KAAI,MAAM,OAAO,QAAQ,KACxB,OAAM,KAAK,CAAC,KAAK,SAAS,CAAC;AAI7B,QAAM,KAAK;GAAE,GAAG;GAAM;GAAO,CAAC;;AAG/B,QAAO;EACN,KAAK,GAAG,MAAM,UAAU,GAAG;EAC3B,MAAM,MAAM;EACZ,YAAY,QAAQ;EACpB,QAAQ;GACP,UAAU;GACV,WAAW,MAAM;GACjB;GACA;GACA;EACD"}
1
+ {"version":3,"file":"sliceContent.js","names":[],"sources":["../../src/helpers/sliceContent.ts"],"sourcesContent":["import type { GroupItemContent } from \"../content/group\"\nimport type { SharedSliceContent } from \"../content/slice\"\nimport type {\n\tCompositeSliceItemContent,\n\tLegacySliceItemContent,\n\tSharedSliceItemContent,\n} from \"../content/slices\"\nimport type { SharedSliceVariationContentModel } from \"../model/slice\"\n\nexport const legacyToShared = (\n\tcontent: LegacySliceItemContent,\n\tmodel: SharedSliceVariationContentModel,\n): SharedSliceItemContent => {\n\tconst sliceUUID = content.key.split(\"$\")[1]\n\n\tconst primary: SharedSliceContent[\"primary\"] = {}\n\tconst items: SharedSliceContent[\"items\"] = []\n\tif (content.widget.__TYPE__ === \"GroupContentType\") {\n\t\t// Group content\n\t\tfor (const item of content.widget.value) {\n\t\t\tconst value: GroupItemContent[\"value\"] = []\n\n\t\t\tfor (const [key, nestable] of item.value) {\n\t\t\t\tif (model.fields.items?.[key]) {\n\t\t\t\t\tvalue.push([key, nestable])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titems.push({ ...item, value })\n\t\t}\n\t} else if (model.fields.primary?.[content.name]) {\n\t\t// Nestable content\n\t\tprimary[content.name] = content.widget\n\t}\n\n\treturn {\n\t\tkey: `${model.sliceName}$${sliceUUID}`,\n\t\tname: model.sliceName,\n\t\tmaybeLabel: content.maybeLabel,\n\t\twidget: {\n\t\t\t__TYPE__: \"SharedSliceContent\",\n\t\t\tvariation: model.variationID,\n\t\t\tprimary,\n\t\t\titems,\n\t\t},\n\t}\n}\n\nexport const compositeToShared = (\n\tcontent: CompositeSliceItemContent,\n\tmodel: SharedSliceVariationContentModel,\n): SharedSliceItemContent => {\n\tconst sliceUUID = content.key.split(\"$\")[1]\n\n\tconst primary: SharedSliceContent[\"primary\"] = {}\n\tfor (const [key, value] of Object.entries(content.widget.nonRepeat)) {\n\t\tif (model.fields.primary?.[key]) {\n\t\t\tprimary[key] = value\n\t\t}\n\t}\n\n\tconst items: SharedSliceContent[\"items\"] = []\n\tfor (const item of content.widget.repeat) {\n\t\tconst value: GroupItemContent[\"value\"] = []\n\n\t\tfor (const [key, nestable] of item.value) {\n\t\t\tif (model.fields.items?.[key]) {\n\t\t\t\tvalue.push([key, nestable])\n\t\t\t}\n\t\t}\n\n\t\titems.push({ ...item, value })\n\t}\n\n\treturn {\n\t\tkey: `${model.sliceName}$${sliceUUID}`,\n\t\tname: model.sliceName,\n\t\tmaybeLabel: content.maybeLabel,\n\t\twidget: {\n\t\t\t__TYPE__: \"SharedSliceContent\",\n\t\t\tvariation: model.variationID,\n\t\t\tprimary,\n\t\t\titems,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;AASA,MAAa,kBACZ,SACA,UAC4B;CAC5B,MAAM,YAAY,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC;CAEzC,MAAM,UAAyC,CAAC;CAChD,MAAM,QAAqC,CAAC;CAC5C,IAAI,QAAQ,OAAO,aAAa,oBAE/B,KAAK,MAAM,QAAQ,QAAQ,OAAO,OAAO;EACxC,MAAM,QAAmC,CAAC;EAE1C,KAAK,MAAM,CAAC,KAAK,aAAa,KAAK,OAClC,IAAI,MAAM,OAAO,QAAQ,MACxB,MAAM,KAAK,CAAC,KAAK,QAAQ,CAAC;EAI5B,MAAM,KAAK;GAAE,GAAG;GAAM;EAAM,CAAC;CAC9B;MACM,IAAI,MAAM,OAAO,UAAU,QAAQ,OAEzC,QAAQ,QAAQ,QAAQ,QAAQ;CAGjC,OAAO;EACN,KAAK,GAAG,MAAM,UAAU,GAAG;EAC3B,MAAM,MAAM;EACZ,YAAY,QAAQ;EACpB,QAAQ;GACP,UAAU;GACV,WAAW,MAAM;GACjB;GACA;EACD;CACD;AACD;AAEA,MAAa,qBACZ,SACA,UAC4B;CAC5B,MAAM,YAAY,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC;CAEzC,MAAM,UAAyC,CAAC;CAChD,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,OAAO,SAAS,GACjE,IAAI,MAAM,OAAO,UAAU,MAC1B,QAAQ,OAAO;CAIjB,MAAM,QAAqC,CAAC;CAC5C,KAAK,MAAM,QAAQ,QAAQ,OAAO,QAAQ;EACzC,MAAM,QAAmC,CAAC;EAE1C,KAAK,MAAM,CAAC,KAAK,aAAa,KAAK,OAClC,IAAI,MAAM,OAAO,QAAQ,MACxB,MAAM,KAAK,CAAC,KAAK,QAAQ,CAAC;EAI5B,MAAM,KAAK;GAAE,GAAG;GAAM;EAAM,CAAC;CAC9B;CAEA,OAAO;EACN,KAAK,GAAG,MAAM,UAAU,GAAG;EAC3B,MAAM,MAAM;EACZ,YAAY,QAAQ;EACpB,QAAQ;GACP,UAAU;GACV,WAAW,MAAM;GACjB;GACA;EACD;CACD;AACD"}
@@ -4,5 +4,5 @@ declare namespace sliceModel_d_exports {
4
4
  declare function serializeID(input: string): string;
5
5
  declare const serializeVariationID: typeof serializeID;
6
6
  //#endregion
7
- export { sliceModel_d_exports };
7
+ export { serializeID, serializeVariationID, sliceModel_d_exports };
8
8
  //# sourceMappingURL=sliceModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sliceModel.d.ts","names":[],"sources":["../../src/helpers/sliceModel.ts"],"mappings":";;;iBAAgB,WAAA,CAAY,KAAA;AAAA,cAiBf,oBAAA,SAAoB,WAAA"}
1
+ {"version":3,"file":"sliceModel.d.ts","names":[],"sources":["../../src/helpers/sliceModel.ts"],"mappings":";;;iBAAgB,YAAY;cAiBf,6BAAoB"}
@@ -11,6 +11,6 @@ function serializeID(input) {
11
11
  }
12
12
  const serializeVariationID = serializeID;
13
13
  //#endregion
14
- export { sliceModel_exports };
14
+ export { serializeID, serializeVariationID, sliceModel_exports };
15
15
 
16
16
  //# sourceMappingURL=sliceModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sliceModel.js","names":[],"sources":["../../src/helpers/sliceModel.ts"],"sourcesContent":["export function serializeID(input: string): string {\n\tconst tokens = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.split(/[^A-Za-z0-9]+/)\n\t\t.filter(Boolean)\n\n\tif (tokens.length === 0) {\n\t\tthrow new Error(`Cannot serialize \"${input}\": result is empty.`)\n\t}\n\n\treturn tokens\n\t\t.map((token) => token.charAt(0).toUpperCase() + token.slice(1).toLowerCase())\n\t\t.join(\"\")\n}\n\nexport const serializeVariationID = serializeID\n"],"mappings":";;;;;;AAAA,SAAgB,YAAY,OAAuB;CAClD,MAAM,SAAS,MACb,MAAM,CACN,UAAU,MAAM,CAChB,QAAQ,WAAW,GAAG,CACtB,MAAM,gBAAgB,CACtB,OAAO,QAAQ;AAEjB,KAAI,OAAO,WAAW,EACrB,OAAM,IAAI,MAAM,qBAAqB,MAAM,qBAAqB;AAGjE,QAAO,OACL,KAAK,UAAU,MAAM,OAAO,EAAE,CAAC,aAAa,GAAG,MAAM,MAAM,EAAE,CAAC,aAAa,CAAC,CAC5E,KAAK,GAAG;;AAGX,MAAa,uBAAuB"}
1
+ {"version":3,"file":"sliceModel.js","names":[],"sources":["../../src/helpers/sliceModel.ts"],"sourcesContent":["export function serializeID(input: string): string {\n\tconst tokens = input\n\t\t.trim()\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.split(/[^A-Za-z0-9]+/)\n\t\t.filter(Boolean)\n\n\tif (tokens.length === 0) {\n\t\tthrow new Error(`Cannot serialize \"${input}\": result is empty.`)\n\t}\n\n\treturn tokens\n\t\t.map((token) => token.charAt(0).toUpperCase() + token.slice(1).toLowerCase())\n\t\t.join(\"\")\n}\n\nexport const serializeVariationID = serializeID\n"],"mappings":";;;;;;AAAA,SAAgB,YAAY,OAAuB;CAClD,MAAM,SAAS,MACb,KAAK,CAAC,CACN,UAAU,KAAK,CAAC,CAChB,QAAQ,WAAW,EAAE,CAAC,CACtB,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO;CAEhB,IAAI,OAAO,WAAW,GACrB,MAAM,IAAI,MAAM,qBAAqB,MAAM,oBAAoB;CAGhE,OAAO,OACL,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAC5E,KAAK,EAAE;AACV;AAEA,MAAa,uBAAuB"}
@@ -13,7 +13,6 @@ import { StaticSlicesModel } from "../model/slices.js";
13
13
  import { StaticWidgetModel } from "../model/widget.js";
14
14
  import { StaticCustomTypeModel } from "../model/customType.js";
15
15
  import { Path } from "./contentPath.js";
16
-
17
16
  //#region src/helpers/traverseContent.d.ts
18
17
  type TraverseDocumentContentConfig = {
19
18
  model?: StaticCustomTypeModel;