@nascentdigital/funnel-core 4.4.4

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 (368) hide show
  1. package/dist/app/AppConfig.d.ts +41 -0
  2. package/dist/app/AppConfig.js +93 -0
  3. package/dist/app/BrandConfig.d.ts +13 -0
  4. package/dist/app/BrandConfig.js +2 -0
  5. package/dist/app/FeaturesConfig.d.ts +6 -0
  6. package/dist/app/FeaturesConfig.js +2 -0
  7. package/dist/app/RegionsConfig.d.ts +43 -0
  8. package/dist/app/RegionsConfig.js +113 -0
  9. package/dist/app/UIConfig.d.ts +4 -0
  10. package/dist/app/UIConfig.js +2 -0
  11. package/dist/app/index.d.ts +5 -0
  12. package/dist/app/index.js +21 -0
  13. package/dist/consent/ConsentCategory.d.ts +12 -0
  14. package/dist/consent/ConsentCategory.js +28 -0
  15. package/dist/consent/ConsentService.d.ts +15 -0
  16. package/dist/consent/ConsentService.js +37 -0
  17. package/dist/consent/index.d.ts +2 -0
  18. package/dist/consent/index.js +18 -0
  19. package/dist/errors/IsometricError.d.ts +19 -0
  20. package/dist/errors/IsometricError.js +30 -0
  21. package/dist/errors/IsometricErrorModule.d.ts +11 -0
  22. package/dist/errors/IsometricErrorModule.js +2 -0
  23. package/dist/errors/IsometricErrorUtils.d.ts +9 -0
  24. package/dist/errors/IsometricErrorUtils.js +85 -0
  25. package/dist/errors/SerializedIsometricError.d.ts +10 -0
  26. package/dist/errors/SerializedIsometricError.js +15 -0
  27. package/dist/errors/api/ApiError.d.ts +15 -0
  28. package/dist/errors/api/ApiError.js +23 -0
  29. package/dist/errors/api/ApiErrors.d.ts +7 -0
  30. package/dist/errors/api/ApiErrors.js +67 -0
  31. package/dist/errors/api/ArgumentError.d.ts +7 -0
  32. package/dist/errors/api/ArgumentError.js +18 -0
  33. package/dist/errors/api/ConcurrencyError.d.ts +4 -0
  34. package/dist/errors/api/ConcurrencyError.js +11 -0
  35. package/dist/errors/api/ConflictError.d.ts +4 -0
  36. package/dist/errors/api/ConflictError.js +11 -0
  37. package/dist/errors/api/DependencyError.d.ts +4 -0
  38. package/dist/errors/api/DependencyError.js +11 -0
  39. package/dist/errors/api/IllegalStateError.d.ts +4 -0
  40. package/dist/errors/api/IllegalStateError.js +11 -0
  41. package/dist/errors/api/InvalidOperationError.d.ts +4 -0
  42. package/dist/errors/api/InvalidOperationError.js +11 -0
  43. package/dist/errors/api/NotAuthenticatedError.d.ts +4 -0
  44. package/dist/errors/api/NotAuthenticatedError.js +11 -0
  45. package/dist/errors/api/NotAuthorizedError.d.ts +4 -0
  46. package/dist/errors/api/NotAuthorizedError.js +11 -0
  47. package/dist/errors/api/NotAvailableError.d.ts +4 -0
  48. package/dist/errors/api/NotAvailableError.js +11 -0
  49. package/dist/errors/api/NotFoundError.d.ts +4 -0
  50. package/dist/errors/api/NotFoundError.js +11 -0
  51. package/dist/errors/api/NotImplementedError.d.ts +4 -0
  52. package/dist/errors/api/NotImplementedError.js +11 -0
  53. package/dist/errors/api/OfflineError.d.ts +4 -0
  54. package/dist/errors/api/OfflineError.js +11 -0
  55. package/dist/errors/api/RangeError.d.ts +4 -0
  56. package/dist/errors/api/RangeError.js +11 -0
  57. package/dist/errors/api/ServerError.d.ts +4 -0
  58. package/dist/errors/api/ServerError.js +11 -0
  59. package/dist/errors/api/TimeoutError.d.ts +4 -0
  60. package/dist/errors/api/TimeoutError.js +11 -0
  61. package/dist/errors/api/index.d.ts +16 -0
  62. package/dist/errors/api/index.js +32 -0
  63. package/dist/errors/index.d.ts +5 -0
  64. package/dist/errors/index.js +26 -0
  65. package/dist/forms/FormModel.d.ts +47 -0
  66. package/dist/forms/FormModel.js +149 -0
  67. package/dist/forms/Forms.d.ts +15 -0
  68. package/dist/forms/Forms.js +35 -0
  69. package/dist/forms/IFormService.d.ts +6 -0
  70. package/dist/forms/IFormService.js +2 -0
  71. package/dist/forms/TranslateSchema.d.ts +8 -0
  72. package/dist/forms/TranslateSchema.js +2 -0
  73. package/dist/forms/index.d.ts +4 -0
  74. package/dist/forms/index.js +20 -0
  75. package/dist/index.d.ts +10 -0
  76. package/dist/index.js +49 -0
  77. package/dist/regionalization/Country.d.ts +266 -0
  78. package/dist/regionalization/Country.js +338 -0
  79. package/dist/regionalization/Language.d.ts +199 -0
  80. package/dist/regionalization/Language.js +237 -0
  81. package/dist/regionalization/Locale.d.ts +28 -0
  82. package/dist/regionalization/Locale.js +49 -0
  83. package/dist/regionalization/Localized.d.ts +10 -0
  84. package/dist/regionalization/Localized.js +36 -0
  85. package/dist/regionalization/LocalizedCopy.d.ts +9 -0
  86. package/dist/regionalization/LocalizedCopy.js +26 -0
  87. package/dist/regionalization/Regionalization.d.ts +50 -0
  88. package/dist/regionalization/Regionalization.js +260 -0
  89. package/dist/regionalization/Regions.d.ts +2 -0
  90. package/dist/regionalization/Regions.js +2 -0
  91. package/dist/regionalization/index.d.ts +7 -0
  92. package/dist/regionalization/index.js +23 -0
  93. package/dist/schema/Asset.d.ts +23 -0
  94. package/dist/schema/Asset.js +36 -0
  95. package/dist/schema/AssetScope.d.ts +75 -0
  96. package/dist/schema/AssetScope.js +146 -0
  97. package/dist/schema/Block.d.ts +105 -0
  98. package/dist/schema/Block.js +122 -0
  99. package/dist/schema/ChangeSet.d.ts +108 -0
  100. package/dist/schema/ChangeSet.js +187 -0
  101. package/dist/schema/Collection.d.ts +197 -0
  102. package/dist/schema/Collection.js +165 -0
  103. package/dist/schema/CollectionModel.d.ts +30 -0
  104. package/dist/schema/CollectionModel.js +383 -0
  105. package/dist/schema/CollectionSnapshot.d.ts +11 -0
  106. package/dist/schema/CollectionSnapshot.js +12 -0
  107. package/dist/schema/Fields.d.ts +31 -0
  108. package/dist/schema/Fields.js +21 -0
  109. package/dist/schema/Form.d.ts +31 -0
  110. package/dist/schema/Form.js +23 -0
  111. package/dist/schema/LinkedCollectionModel.d.ts +9 -0
  112. package/dist/schema/LinkedCollectionModel.js +19 -0
  113. package/dist/schema/LinkedData.d.ts +44 -0
  114. package/dist/schema/LinkedData.js +288 -0
  115. package/dist/schema/LinkedPageModel.d.ts +11 -0
  116. package/dist/schema/LinkedPageModel.js +26 -0
  117. package/dist/schema/Optional.d.ts +23 -0
  118. package/dist/schema/Optional.js +34 -0
  119. package/dist/schema/Page.d.ts +299 -0
  120. package/dist/schema/Page.js +244 -0
  121. package/dist/schema/PageModel.d.ts +58 -0
  122. package/dist/schema/PageModel.js +881 -0
  123. package/dist/schema/PageQuery.d.ts +60 -0
  124. package/dist/schema/PageQuery.js +116 -0
  125. package/dist/schema/PageRoute.d.ts +7 -0
  126. package/dist/schema/PageRoute.js +48 -0
  127. package/dist/schema/PageSnapshot.d.ts +11 -0
  128. package/dist/schema/PageSnapshot.js +12 -0
  129. package/dist/schema/Section.d.ts +71 -0
  130. package/dist/schema/Section.js +35 -0
  131. package/dist/schema/Seo.d.ts +13 -0
  132. package/dist/schema/Seo.js +25 -0
  133. package/dist/schema/Site.d.ts +40 -0
  134. package/dist/schema/Site.js +87 -0
  135. package/dist/schema/SiteModel.d.ts +5 -0
  136. package/dist/schema/SiteModel.js +10 -0
  137. package/dist/schema/Tag.d.ts +28 -0
  138. package/dist/schema/Tag.js +59 -0
  139. package/dist/schema/TagGroup.d.ts +26 -0
  140. package/dist/schema/TagGroup.js +64 -0
  141. package/dist/schema/field/Field.d.ts +179 -0
  142. package/dist/schema/field/Field.js +309 -0
  143. package/dist/schema/field/base/AssetField.d.ts +148 -0
  144. package/dist/schema/field/base/AssetField.js +206 -0
  145. package/dist/schema/field/base/BooleanField.d.ts +21 -0
  146. package/dist/schema/field/base/BooleanField.js +38 -0
  147. package/dist/schema/field/base/CollectionField.d.ts +34 -0
  148. package/dist/schema/field/base/CollectionField.js +85 -0
  149. package/dist/schema/field/base/DateField.d.ts +21 -0
  150. package/dist/schema/field/base/DateField.js +37 -0
  151. package/dist/schema/field/base/DynamicPagesField.d.ts +36 -0
  152. package/dist/schema/field/base/DynamicPagesField.js +50 -0
  153. package/dist/schema/field/base/EmbeddedVideoField.d.ts +45 -0
  154. package/dist/schema/field/base/EmbeddedVideoField.js +176 -0
  155. package/dist/schema/field/base/EnumField.d.ts +40 -0
  156. package/dist/schema/field/base/EnumField.js +131 -0
  157. package/dist/schema/field/base/FormField.d.ts +25 -0
  158. package/dist/schema/field/base/FormField.js +48 -0
  159. package/dist/schema/field/base/LinkField.d.ts +103 -0
  160. package/dist/schema/field/base/LinkField.js +201 -0
  161. package/dist/schema/field/base/PageField.d.ts +46 -0
  162. package/dist/schema/field/base/PageField.js +83 -0
  163. package/dist/schema/field/base/RichTextField.d.ts +71 -0
  164. package/dist/schema/field/base/RichTextField.js +196 -0
  165. package/dist/schema/field/base/TextField.d.ts +33 -0
  166. package/dist/schema/field/base/TextField.js +86 -0
  167. package/dist/schema/field/base/TimestampField.d.ts +25 -0
  168. package/dist/schema/field/base/TimestampField.js +41 -0
  169. package/dist/schema/field/base/index.d.ts +13 -0
  170. package/dist/schema/field/base/index.js +29 -0
  171. package/dist/schema/field/composite/ListField.d.ts +47 -0
  172. package/dist/schema/field/composite/ListField.js +107 -0
  173. package/dist/schema/field/composite/ObjectField.d.ts +56 -0
  174. package/dist/schema/field/composite/ObjectField.js +19 -0
  175. package/dist/schema/field/composite/index.d.ts +2 -0
  176. package/dist/schema/field/composite/index.js +18 -0
  177. package/dist/schema/field/index.d.ts +3 -0
  178. package/dist/schema/field/index.js +19 -0
  179. package/dist/schema/index.d.ts +25 -0
  180. package/dist/schema/index.js +41 -0
  181. package/dist/services/EventBus.d.ts +17 -0
  182. package/dist/services/EventBus.js +37 -0
  183. package/dist/services/humanVerification/IHumanVerification.d.ts +8 -0
  184. package/dist/services/humanVerification/IHumanVerification.js +2 -0
  185. package/dist/services/humanVerification/index.d.ts +1 -0
  186. package/dist/services/humanVerification/index.js +17 -0
  187. package/dist/services/index.d.ts +3 -0
  188. package/dist/services/index.js +19 -0
  189. package/dist/services/leadGen/Contact.d.ts +40 -0
  190. package/dist/services/leadGen/Contact.js +38 -0
  191. package/dist/services/leadGen/ILeadGen.d.ts +16 -0
  192. package/dist/services/leadGen/ILeadGen.js +2 -0
  193. package/dist/services/leadGen/index.d.ts +2 -0
  194. package/dist/services/leadGen/index.js +18 -0
  195. package/dist/types/BoxedValue.d.ts +3 -0
  196. package/dist/types/BoxedValue.js +2 -0
  197. package/dist/types/Callback.d.ts +9 -0
  198. package/dist/types/Callback.js +2 -0
  199. package/dist/types/DateString.d.ts +35 -0
  200. package/dist/types/DateString.js +172 -0
  201. package/dist/types/FilterConditionally.d.ts +3 -0
  202. package/dist/types/FilterConditionally.js +2 -0
  203. package/dist/types/MaybeConditionalValue.d.ts +8 -0
  204. package/dist/types/MaybeConditionalValue.js +12 -0
  205. package/dist/types/Ordinal.d.ts +17 -0
  206. package/dist/types/Ordinal.js +38 -0
  207. package/dist/types/OverridableStringUnion.d.ts +2 -0
  208. package/dist/types/OverridableStringUnion.js +2 -0
  209. package/dist/types/PartialBy.d.ts +1 -0
  210. package/dist/types/PartialBy.js +2 -0
  211. package/dist/types/PickData.d.ts +6 -0
  212. package/dist/types/PickData.js +2 -0
  213. package/dist/types/Provider.d.ts +4 -0
  214. package/dist/types/Provider.js +2 -0
  215. package/dist/types/RequiredBy.d.ts +1 -0
  216. package/dist/types/RequiredBy.js +2 -0
  217. package/dist/types/Result.d.ts +16 -0
  218. package/dist/types/Result.js +2 -0
  219. package/dist/types/Timestamp.d.ts +17 -0
  220. package/dist/types/Timestamp.js +57 -0
  221. package/dist/types/Transform.d.ts +4 -0
  222. package/dist/types/Transform.js +2 -0
  223. package/dist/types/index.d.ts +14 -0
  224. package/dist/types/index.js +30 -0
  225. package/dist/ui/Accessible.d.ts +5 -0
  226. package/dist/ui/Accessible.js +15 -0
  227. package/dist/ui/BlockThemes.d.ts +19 -0
  228. package/dist/ui/BlockThemes.js +29 -0
  229. package/dist/ui/ColorMode.d.ts +12 -0
  230. package/dist/ui/ColorMode.js +49 -0
  231. package/dist/ui/File.d.ts +43 -0
  232. package/dist/ui/File.js +55 -0
  233. package/dist/ui/FileType.d.ts +8 -0
  234. package/dist/ui/FileType.js +48 -0
  235. package/dist/ui/ImageSource.d.ts +12 -0
  236. package/dist/ui/ImageSource.js +48 -0
  237. package/dist/ui/MimeType.d.ts +28 -0
  238. package/dist/ui/MimeType.js +110 -0
  239. package/dist/ui/Placement.d.ts +21 -0
  240. package/dist/ui/Placement.js +135 -0
  241. package/dist/ui/Position.d.ts +6 -0
  242. package/dist/ui/Position.js +42 -0
  243. package/dist/ui/Selector.d.ts +6 -0
  244. package/dist/ui/Selector.js +23 -0
  245. package/dist/ui/SemanticColor.d.ts +8 -0
  246. package/dist/ui/SemanticColor.js +237 -0
  247. package/dist/ui/Visual.d.ts +24 -0
  248. package/dist/ui/Visual.js +66 -0
  249. package/dist/ui/block-layout/BlockLayout.d.ts +99 -0
  250. package/dist/ui/block-layout/BlockLayout.js +286 -0
  251. package/dist/ui/block-layout/index.d.ts +1 -0
  252. package/dist/ui/block-layout/index.js +17 -0
  253. package/dist/ui/browser/BlurHasher.d.ts +13 -0
  254. package/dist/ui/browser/BlurHasher.js +76 -0
  255. package/dist/ui/browser/Browser.d.ts +107 -0
  256. package/dist/ui/browser/Browser.js +313 -0
  257. package/dist/ui/browser/ImageProxy.d.ts +30 -0
  258. package/dist/ui/browser/ImageProxy.js +132 -0
  259. package/dist/ui/browser/InputEvent.d.ts +13 -0
  260. package/dist/ui/browser/InputEvent.js +2 -0
  261. package/dist/ui/browser/SVGProxy.d.ts +9 -0
  262. package/dist/ui/browser/SVGProxy.js +59 -0
  263. package/dist/ui/browser/VideoProxy.d.ts +42 -0
  264. package/dist/ui/browser/VideoProxy.js +235 -0
  265. package/dist/ui/browser/index.d.ts +6 -0
  266. package/dist/ui/browser/index.js +22 -0
  267. package/dist/ui/fields/Field.d.ts +80 -0
  268. package/dist/ui/fields/Field.js +298 -0
  269. package/dist/ui/fields/FieldList.d.ts +80 -0
  270. package/dist/ui/fields/FieldList.js +421 -0
  271. package/dist/ui/fields/FieldListValidator.d.ts +9 -0
  272. package/dist/ui/fields/FieldListValidator.js +37 -0
  273. package/dist/ui/fields/FieldModel.d.ts +15 -0
  274. package/dist/ui/fields/FieldModel.js +28 -0
  275. package/dist/ui/fields/FieldSerializer.d.ts +13 -0
  276. package/dist/ui/fields/FieldSerializer.js +71 -0
  277. package/dist/ui/fields/FieldValidator.d.ts +19 -0
  278. package/dist/ui/fields/FieldValidator.js +98 -0
  279. package/dist/ui/fields/ObjectField.d.ts +75 -0
  280. package/dist/ui/fields/ObjectField.js +288 -0
  281. package/dist/ui/fields/errors.json +44 -0
  282. package/dist/ui/fields/index.d.ts +7 -0
  283. package/dist/ui/fields/index.js +23 -0
  284. package/dist/ui/fields/validators/AssetValidator.d.ts +9 -0
  285. package/dist/ui/fields/validators/AssetValidator.js +25 -0
  286. package/dist/ui/fields/validators/DateValidator.d.ts +9 -0
  287. package/dist/ui/fields/validators/DateValidator.js +41 -0
  288. package/dist/ui/fields/validators/EnumValidator.d.ts +10 -0
  289. package/dist/ui/fields/validators/EnumValidator.js +77 -0
  290. package/dist/ui/fields/validators/GenericValidator.d.ts +6 -0
  291. package/dist/ui/fields/validators/GenericValidator.js +22 -0
  292. package/dist/ui/fields/validators/LinkValidator.d.ts +9 -0
  293. package/dist/ui/fields/validators/LinkValidator.js +146 -0
  294. package/dist/ui/fields/validators/RichTextValidator.d.ts +6 -0
  295. package/dist/ui/fields/validators/RichTextValidator.js +35 -0
  296. package/dist/ui/fields/validators/TextValidator.d.ts +10 -0
  297. package/dist/ui/fields/validators/TextValidator.js +138 -0
  298. package/dist/ui/fields/validators/TimestampValidator.d.ts +9 -0
  299. package/dist/ui/fields/validators/TimestampValidator.js +41 -0
  300. package/dist/ui/fields/validators/ValidatorHelper.d.ts +23 -0
  301. package/dist/ui/fields/validators/ValidatorHelper.js +55 -0
  302. package/dist/ui/fields/validators/index.d.ts +8 -0
  303. package/dist/ui/fields/validators/index.js +24 -0
  304. package/dist/ui/geometry/AspectRatio.d.ts +27 -0
  305. package/dist/ui/geometry/AspectRatio.js +77 -0
  306. package/dist/ui/geometry/Bounds.d.ts +4 -0
  307. package/dist/ui/geometry/Bounds.js +11 -0
  308. package/dist/ui/geometry/Frame.d.ts +3 -0
  309. package/dist/ui/geometry/Frame.js +2 -0
  310. package/dist/ui/geometry/Insets.d.ts +14 -0
  311. package/dist/ui/geometry/Insets.js +14 -0
  312. package/dist/ui/geometry/PixelSize.d.ts +1 -0
  313. package/dist/ui/geometry/PixelSize.js +2 -0
  314. package/dist/ui/geometry/Point.d.ts +7 -0
  315. package/dist/ui/geometry/Point.js +15 -0
  316. package/dist/ui/geometry/Rect.d.ts +19 -0
  317. package/dist/ui/geometry/Rect.js +68 -0
  318. package/dist/ui/geometry/ScreenSize.d.ts +1 -0
  319. package/dist/ui/geometry/ScreenSize.js +2 -0
  320. package/dist/ui/geometry/Size.d.ts +7 -0
  321. package/dist/ui/geometry/Size.js +9 -0
  322. package/dist/ui/geometry/index.d.ts +9 -0
  323. package/dist/ui/geometry/index.js +25 -0
  324. package/dist/ui/index.d.ts +18 -0
  325. package/dist/ui/index.js +34 -0
  326. package/dist/ui/responsive/Breakpoint.d.ts +8 -0
  327. package/dist/ui/responsive/Breakpoint.js +24 -0
  328. package/dist/ui/responsive/BreakpointObserver.d.ts +16 -0
  329. package/dist/ui/responsive/BreakpointObserver.js +104 -0
  330. package/dist/ui/responsive/Breakpoints.d.ts +5 -0
  331. package/dist/ui/responsive/Breakpoints.js +15 -0
  332. package/dist/ui/responsive/ResponsiveValue.d.ts +7 -0
  333. package/dist/ui/responsive/ResponsiveValue.js +26 -0
  334. package/dist/ui/responsive/index.d.ts +4 -0
  335. package/dist/ui/responsive/index.js +20 -0
  336. package/dist/ui/richtext/LexicalUtils.d.ts +31 -0
  337. package/dist/ui/richtext/LexicalUtils.js +314 -0
  338. package/dist/ui/richtext/StyledTextNode.d.ts +33 -0
  339. package/dist/ui/richtext/StyledTextNode.js +101 -0
  340. package/dist/ui/richtext/index.d.ts +2 -0
  341. package/dist/ui/richtext/index.js +18 -0
  342. package/dist/utils/ArrayUtils.d.ts +17 -0
  343. package/dist/utils/ArrayUtils.js +66 -0
  344. package/dist/utils/ByteSize.d.ts +19 -0
  345. package/dist/utils/ByteSize.js +33 -0
  346. package/dist/utils/DateUtils.d.ts +15 -0
  347. package/dist/utils/DateUtils.js +100 -0
  348. package/dist/utils/Deferral.d.ts +28 -0
  349. package/dist/utils/Deferral.js +107 -0
  350. package/dist/utils/Duration.d.ts +7 -0
  351. package/dist/utils/Duration.js +35 -0
  352. package/dist/utils/Fn.d.ts +14 -0
  353. package/dist/utils/Fn.js +52 -0
  354. package/dist/utils/ObjectUtils.d.ts +89 -0
  355. package/dist/utils/ObjectUtils.js +159 -0
  356. package/dist/utils/Random.d.ts +15 -0
  357. package/dist/utils/Random.js +72 -0
  358. package/dist/utils/StringUtils.d.ts +10 -0
  359. package/dist/utils/StringUtils.js +51 -0
  360. package/dist/utils/UrlUtils.d.ts +22 -0
  361. package/dist/utils/UrlUtils.js +119 -0
  362. package/dist/utils/Value.d.ts +23 -0
  363. package/dist/utils/Value.js +122 -0
  364. package/dist/utils/index.d.ts +12 -0
  365. package/dist/utils/index.js +28 -0
  366. package/dist/utils/isDefined.d.ts +1 -0
  367. package/dist/utils/isDefined.js +6 -0
  368. package/package.json +64 -0
@@ -0,0 +1,80 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as Schema from '../../schema';
3
+ import { EventBus } from '../../services';
4
+ import { Field } from './Field';
5
+ import { FieldValidator } from './FieldValidator';
6
+ import { ObjectField } from './ObjectField';
7
+ export declare class FieldList {
8
+ readonly schema: FieldList.ListSchema;
9
+ readonly composition: FieldList.ListComposition;
10
+ private _items;
11
+ readonly id: string;
12
+ readonly name: string;
13
+ readonly required: boolean;
14
+ private readonly eventBus;
15
+ readonly initialValue: FieldList.ListValue | undefined;
16
+ readonly publishedValue: FieldList.ListValue | undefined;
17
+ private readonly _validator;
18
+ private _errors;
19
+ private _optIn?;
20
+ private _optOut?;
21
+ constructor(args: FieldList.ConstructorArgs);
22
+ get events$(): Observable<FieldList.Event>;
23
+ get items(): ReadonlyArray<FieldList.Item>;
24
+ get isNew(): boolean;
25
+ get exists(): boolean;
26
+ get valid(): boolean;
27
+ get filteredErrors(): readonly FieldValidator.Error[];
28
+ get error(): FieldValidator.Error | undefined;
29
+ get errors(): FieldValidator.Error[];
30
+ get hasValue(): boolean;
31
+ get value(): FieldList.ListValue | undefined;
32
+ set value(value: FieldList.ListValue | undefined);
33
+ get modified(): boolean;
34
+ get changed(): boolean;
35
+ get canOptOut(): boolean;
36
+ optIn(): void;
37
+ optOut(): void;
38
+ get optedOut(): boolean;
39
+ get shouldFocus(): boolean;
40
+ didFocus(): boolean;
41
+ validate(): ReadonlyArray<FieldValidator.Error>;
42
+ get canAdd(): boolean;
43
+ addItem({ schema: schemaId, id, ...value }: FieldList.ItemValue): FieldList.Item<Schema.ListField.Content.Type>;
44
+ removeItems(itemIds: ReadonlyArray<string>): void;
45
+ removeItem(itemId: string): void;
46
+ removeField(field: Field | ObjectField): void;
47
+ moveItem(fromIndex: number, toIndex: number): void;
48
+ reset(initialValue?: FieldList.ListValue | null): void;
49
+ clone(): FieldList;
50
+ private raiseEvent;
51
+ }
52
+ export declare namespace FieldList {
53
+ type ConstructorArgs = {
54
+ eventBus: EventBus;
55
+ schema: ListSchema;
56
+ id: string;
57
+ name: string;
58
+ initialValue?: ListValue;
59
+ publishedValue?: ListValue;
60
+ required: boolean;
61
+ };
62
+ type ListComposition = 'simple' | 'complex.single' | 'complex.multi' | 'mixed';
63
+ type ListSchema = Schema.ListField<Schema.ListField.Content>;
64
+ type ListValue = Schema.Field.Data<ListSchema>;
65
+ type ItemSchema = Schema.ListField.Content[keyof Schema.ListField.Content];
66
+ type Item<TItemSchema extends ItemSchema = ItemSchema> = {
67
+ schema: string;
68
+ id: string;
69
+ field: Field<TItemSchema> | ObjectField;
70
+ };
71
+ type ItemValue = Schema.ListField.Value.ForItem<Schema.ListField.Content>;
72
+ interface Event extends EventBus.Event<'FieldList', Event.Type> {
73
+ field: FieldList;
74
+ }
75
+ namespace Event {
76
+ type Type = 'changed' | 'validation';
77
+ function filter(event: EventBus.Event): event is Event;
78
+ function create(event: EventBus.Args<Event>): Event;
79
+ }
80
+ }
@@ -0,0 +1,421 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __rest = (this && this.__rest) || function (s, e) {
36
+ var t = {};
37
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
38
+ t[p] = s[p];
39
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
40
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
41
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
42
+ t[p[i]] = s[p[i]];
43
+ }
44
+ return t;
45
+ };
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.FieldList = void 0;
48
+ const rxjs_1 = require("rxjs");
49
+ const errors_1 = require("../../errors");
50
+ const Schema = __importStar(require("../../schema"));
51
+ const services_1 = require("../../services");
52
+ const utils_1 = require("../../utils");
53
+ const Field_1 = require("./Field");
54
+ const FieldListValidator_1 = require("./FieldListValidator");
55
+ const FieldValidator_1 = require("./FieldValidator");
56
+ const ObjectField_1 = require("./ObjectField");
57
+ // class
58
+ class FieldList {
59
+ constructor(args) {
60
+ // initialize instance variables
61
+ this.eventBus = args.eventBus;
62
+ this.schema = args.schema;
63
+ this.composition = getListComposition(args.schema);
64
+ this._items = deserializeItems({
65
+ eventBus: args.eventBus,
66
+ schema: args.schema,
67
+ value: args.initialValue,
68
+ publishedValue: args.publishedValue,
69
+ });
70
+ this.id = args.id;
71
+ this.name = args.name;
72
+ this.required = args.required;
73
+ this.initialValue = args.initialValue;
74
+ this.publishedValue = args.publishedValue;
75
+ this._validator = new FieldListValidator_1.FieldListValidator(this.schema);
76
+ // validate
77
+ this._errors = this._validator.validate(this, this.value);
78
+ }
79
+ get events$() {
80
+ return this.eventBus.events$.pipe((0, rxjs_1.filter)(FieldList.Event.filter), (0, rxjs_1.filter)(e => e.field === this));
81
+ }
82
+ get items() {
83
+ return this._items;
84
+ }
85
+ get isNew() {
86
+ const { exists, initialValue } = this;
87
+ return exists && initialValue === undefined;
88
+ }
89
+ get exists() {
90
+ const { initialValue, _optIn = false, _optOut = false, schema: { required } } = this;
91
+ return (initialValue !== undefined && !_optOut) || required || _optIn;
92
+ }
93
+ get valid() {
94
+ return this.errors.length === 0;
95
+ }
96
+ get filteredErrors() {
97
+ return this._validator.filter(this._errors, 'all');
98
+ }
99
+ get error() {
100
+ return FieldValidator_1.FieldValidator.Error.mostRelevant(this.errors);
101
+ }
102
+ get errors() {
103
+ return [...this._errors, ...this._items.flatMap(item => item.field.errors)];
104
+ }
105
+ get hasValue() {
106
+ return this._items.length > 0;
107
+ }
108
+ get value() {
109
+ return this.exists
110
+ ?
111
+ {
112
+ type: 'list',
113
+ value: this._items.map(serializeItem).filter(utils_1.Value.isDefined)
114
+ }
115
+ : undefined;
116
+ }
117
+ set value(value) {
118
+ // ignore if the values are the same
119
+ if (utils_1.Value.equals(this.value, value)) {
120
+ return;
121
+ }
122
+ // update
123
+ const { eventBus, schema, publishedValue } = this;
124
+ this._items = deserializeItems({
125
+ eventBus,
126
+ schema,
127
+ value,
128
+ publishedValue
129
+ });
130
+ // revalidate
131
+ this.validate();
132
+ // raise event
133
+ this.raiseEvent('changed');
134
+ }
135
+ get modified() {
136
+ const { value, initialValue } = this;
137
+ return this._optIn || !utils_1.Value.equals(value, initialValue);
138
+ }
139
+ get changed() {
140
+ const { value, publishedValue } = this;
141
+ return !utils_1.Value.equals(value, publishedValue);
142
+ }
143
+ get canOptOut() {
144
+ return !this.schema.required;
145
+ }
146
+ optIn() {
147
+ // skip if required
148
+ const { schema } = this;
149
+ if (schema.required) {
150
+ return;
151
+ }
152
+ // set opt-in flag
153
+ this._optIn = true;
154
+ this.raiseEvent('changed');
155
+ }
156
+ optOut() {
157
+ // skip if required
158
+ const { schema } = this;
159
+ if (schema.required) {
160
+ return;
161
+ }
162
+ // clear value
163
+ this._optOut = true;
164
+ this._items = [];
165
+ this.raiseEvent('changed');
166
+ }
167
+ get optedOut() {
168
+ var _a;
169
+ return (_a = this._optOut) !== null && _a !== void 0 ? _a : false;
170
+ }
171
+ get shouldFocus() {
172
+ return false;
173
+ }
174
+ didFocus() {
175
+ return false;
176
+ }
177
+ validate() {
178
+ // validate (skip if nothing has changed)
179
+ const errors = this._validator.validate(this, this.value);
180
+ if (utils_1.Value.equals(errors, this._errors)) {
181
+ return this._errors;
182
+ }
183
+ // update errors
184
+ this._errors = errors;
185
+ // raise event
186
+ this.raiseEvent('validation');
187
+ // return errors
188
+ return errors;
189
+ }
190
+ get canAdd() {
191
+ const { schema, _items } = this;
192
+ return _items.length < schema.max;
193
+ }
194
+ addItem(_a) {
195
+ var { schema: schemaId, id } = _a, value = __rest(_a, ["schema", "id"]);
196
+ // create new item
197
+ const { eventBus, schema } = this;
198
+ const itemSchema = schema.itemTypes[schemaId];
199
+ const item = {
200
+ schema: schemaId,
201
+ id,
202
+ field: itemSchema.type === 'object'
203
+ ? new ObjectField_1.ObjectField({
204
+ id,
205
+ eventBus,
206
+ schema: itemSchema,
207
+ name: itemSchema.name,
208
+ initialValue: value,
209
+ publishedValue: undefined,
210
+ required: true
211
+ })
212
+ : new Field_1.Field({
213
+ id,
214
+ eventBus,
215
+ schema: itemSchema,
216
+ name: itemSchema.name,
217
+ initialValue: value,
218
+ publishedValue: undefined,
219
+ required: true
220
+ })
221
+ };
222
+ // add to list
223
+ this._items = [...this._items, item];
224
+ // revalidate
225
+ this.validate();
226
+ // raise event
227
+ this.raiseEvent('changed');
228
+ // return item
229
+ return item;
230
+ }
231
+ removeItems(itemIds) {
232
+ // remove item
233
+ const itemCount = this._items.length;
234
+ this._items = this._items.filter(({ id }) => !itemIds.includes(id));
235
+ // raise event (if there are changes)
236
+ if (this._items.length !== itemCount) {
237
+ // revalidate
238
+ this.validate();
239
+ // raise change
240
+ this.raiseEvent('changed');
241
+ }
242
+ }
243
+ removeItem(itemId) {
244
+ this.removeItems([itemId]);
245
+ }
246
+ removeField(field) {
247
+ // find item (or skip
248
+ const item = this._items.find(item => item.field === field);
249
+ if (!item) {
250
+ return;
251
+ }
252
+ // remove item
253
+ this.removeItems([item.id]);
254
+ }
255
+ moveItem(fromIndex, toIndex) {
256
+ // throw if from/to are out-of-bounds
257
+ const maxIndex = this._items.length - 1;
258
+ if (fromIndex < 0 || toIndex < 0 || fromIndex > maxIndex || toIndex > maxIndex) {
259
+ throw new errors_1.ArgumentError(`Move indices of ${fromIndex} -> ${toIndex} fall outside of range [${0}, ${maxIndex}]`);
260
+ }
261
+ // ignore if from/to are same
262
+ if (fromIndex === toIndex) {
263
+ return;
264
+ }
265
+ // create new items
266
+ const items = this._items.slice();
267
+ const [item] = items.splice(fromIndex, 1);
268
+ items.splice(toIndex, 0, item);
269
+ // update items
270
+ this._items = items;
271
+ // revalidate
272
+ this.validate();
273
+ // raise change
274
+ this.raiseEvent('changed');
275
+ }
276
+ reset(initialValue) {
277
+ // re-bind new initial values
278
+ if (initialValue || initialValue === null) {
279
+ // set items from current value
280
+ this._items = deserializeItems({
281
+ eventBus: this.eventBus,
282
+ schema: this.schema,
283
+ value: initialValue !== null && initialValue !== void 0 ? initialValue : undefined
284
+ });
285
+ }
286
+ // reset each field if there's no initial value
287
+ else {
288
+ this._items.forEach(({ field }) => field.reset());
289
+ }
290
+ // revalidate
291
+ this.validate();
292
+ // raise final change
293
+ this.raiseEvent('changed');
294
+ }
295
+ clone() {
296
+ return new FieldList({
297
+ eventBus: this.eventBus,
298
+ schema: this.schema,
299
+ id: this.id,
300
+ name: this.name,
301
+ publishedValue: this.publishedValue,
302
+ initialValue: this.initialValue,
303
+ required: this.required
304
+ });
305
+ }
306
+ raiseEvent(type) {
307
+ this.eventBus.publish(FieldList.Event.create({ type, field: this }));
308
+ }
309
+ }
310
+ exports.FieldList = FieldList;
311
+ // extension
312
+ (function (FieldList) {
313
+ let Event;
314
+ (function (Event) {
315
+ // methods
316
+ function filter(event) {
317
+ return event.domain === 'FieldList';
318
+ }
319
+ Event.filter = filter;
320
+ function create(event) {
321
+ return services_1.EventBus.createEvent(Object.assign({ domain: 'FieldList' }, event));
322
+ }
323
+ Event.create = create;
324
+ })(Event = FieldList.Event || (FieldList.Event = {}));
325
+ })(FieldList || (exports.FieldList = FieldList = {}));
326
+ // helpers
327
+ function getListComposition(schema) {
328
+ // throw if there are no item types
329
+ const itemTypes = Object.entries(schema.itemTypes);
330
+ if (itemTypes.length === 0) {
331
+ throw new errors_1.ArgumentError('Cannot have list with 0 types');
332
+ }
333
+ // tally types
334
+ let simpleCount = 0;
335
+ let complexCount = 0;
336
+ itemTypes.forEach(([, itemType]) => {
337
+ switch (itemType.type) {
338
+ case 'text':
339
+ case 'richtext':
340
+ case 'enum':
341
+ case 'boolean':
342
+ case 'date':
343
+ case 'timestamp':
344
+ simpleCount += 1;
345
+ break;
346
+ default:
347
+ complexCount += 1;
348
+ break;
349
+ }
350
+ });
351
+ // fail if types are mixed
352
+ if (simpleCount > 0 && complexCount > 0) {
353
+ return 'mixed';
354
+ }
355
+ else if (simpleCount > 0) {
356
+ return 'simple';
357
+ }
358
+ else if (complexCount === 1) {
359
+ return 'complex.single';
360
+ }
361
+ else {
362
+ return 'complex.multi';
363
+ }
364
+ }
365
+ function deserializeItems({ eventBus, schema: listSchema, value, publishedValue }) {
366
+ var _a, _b;
367
+ // convert values
368
+ const itemSchemas = listSchema.itemTypes;
369
+ const values = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : [];
370
+ const publishedValues = (_b = publishedValue === null || publishedValue === void 0 ? void 0 : publishedValue.value) !== null && _b !== void 0 ? _b : [];
371
+ return values
372
+ // drop any values that aren't supported
373
+ .filter(({ schema, type }) => {
374
+ const itemSchema = itemSchemas[schema];
375
+ return !!itemSchema && itemSchema.type === type;
376
+ })
377
+ // map the rest
378
+ .map((_a) => {
379
+ var { schema, id } = _a, item = __rest(_a, ["schema", "id"]);
380
+ // resolve schema
381
+ const itemSchema = itemSchemas[schema];
382
+ // create item
383
+ return {
384
+ schema,
385
+ id,
386
+ field: itemSchema.type === 'object'
387
+ ? new ObjectField_1.ObjectField({
388
+ id: id,
389
+ name: itemSchema.name,
390
+ eventBus,
391
+ schema: itemSchema,
392
+ initialValue: item,
393
+ publishedValue: Schema.ListField.Value.purifyItem(publishedValues.find(item => item.id === id)),
394
+ required: true
395
+ })
396
+ : new Field_1.Field({
397
+ id: id,
398
+ name: itemSchema.name,
399
+ eventBus,
400
+ schema: itemSchema,
401
+ initialValue: item,
402
+ publishedValue: Schema.ListField.Value.purifyItem(publishedValues.find(item => item.id === id)),
403
+ required: true
404
+ })
405
+ };
406
+ });
407
+ }
408
+ function serializeItem(item) {
409
+ var _a;
410
+ // ignore if item has no value
411
+ const { schema, id, field } = item;
412
+ const { value } = field;
413
+ if (value === undefined) {
414
+ return undefined;
415
+ }
416
+ // or return value
417
+ else {
418
+ return Object.assign({ schema,
419
+ id }, ((_a = field.value) !== null && _a !== void 0 ? _a : {}));
420
+ }
421
+ }
@@ -0,0 +1,9 @@
1
+ import type { ListField } from '../../schema/field/composite/ListField';
2
+ import { FieldList } from './FieldList';
3
+ import { FieldValidator } from './FieldValidator';
4
+ export declare class FieldListValidator {
5
+ readonly schema: ListField;
6
+ constructor(schema: ListField);
7
+ filter(errors: ReadonlyArray<FieldValidator.Error>, level: FieldValidator.Error.Level): ReadonlyArray<FieldValidator.Error>;
8
+ validate(field: FieldList, rawData: any): FieldValidator.Error[];
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldListValidator = void 0;
4
+ const ValidatorHelper_1 = require("./validators/ValidatorHelper");
5
+ // class
6
+ class FieldListValidator {
7
+ constructor(schema) {
8
+ this.schema = schema;
9
+ }
10
+ filter(errors, level) {
11
+ return ValidatorHelper_1.ValidatorHelper.filterErrors(errors, level);
12
+ }
13
+ validate(field, rawData) {
14
+ var _a;
15
+ // handle case where unset (fail if not optional)
16
+ const { value: rawValue } = (_a = rawData) !== null && _a !== void 0 ? _a : {};
17
+ const value = Array.isArray(rawValue) ? rawValue : [];
18
+ if (value.length === 0) {
19
+ return field.required
20
+ ? [ValidatorHelper_1.ValidatorHelper.createError({ field, id: 'required', value })]
21
+ : [];
22
+ }
23
+ // fail if min isn't met
24
+ const errors = [];
25
+ const { min, max } = this.schema;
26
+ if (value.length < min) {
27
+ errors.push(ValidatorHelper_1.ValidatorHelper.createError({ field, id: 'array.min', critical: true, value }));
28
+ }
29
+ // or if max is exceeded
30
+ else if (value.length > max) {
31
+ errors.push(ValidatorHelper_1.ValidatorHelper.createError({ field, id: 'array.max', critical: true, value }));
32
+ }
33
+ // return errors
34
+ return errors;
35
+ }
36
+ }
37
+ exports.FieldListValidator = FieldListValidator;
@@ -0,0 +1,15 @@
1
+ import { Field } from './Field';
2
+ import { FieldList } from './FieldList';
3
+ import { ObjectField } from './ObjectField';
4
+ import * as Schema from '../../schema';
5
+ export type FieldModel = Field | FieldList | ObjectField;
6
+ export declare namespace FieldModel {
7
+ type Simple = Field | FieldList;
8
+ type Composite = ObjectField;
9
+ type Config = Field<Schema.Field.Type.Simple.Configuration>;
10
+ function filter(value: any): value is FieldModel;
11
+ type Event = Field.Event | FieldList.Event | ObjectField.Event;
12
+ namespace Event {
13
+ function filter(value: any): value is Event;
14
+ }
15
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldModel = void 0;
4
+ const Field_1 = require("./Field");
5
+ const FieldList_1 = require("./FieldList");
6
+ const ObjectField_1 = require("./ObjectField");
7
+ // extension
8
+ var FieldModel;
9
+ (function (FieldModel) {
10
+ // filter
11
+ function filter(value) {
12
+ return value &&
13
+ (value instanceof Field_1.Field
14
+ || value instanceof FieldList_1.FieldList
15
+ || value instanceof ObjectField_1.ObjectField);
16
+ }
17
+ FieldModel.filter = filter;
18
+ let Event;
19
+ (function (Event) {
20
+ function filter(value) {
21
+ return value &&
22
+ (Field_1.Field.Event.filter(value)
23
+ || FieldList_1.FieldList.Event.filter(value)
24
+ || ObjectField_1.ObjectField.Event.filter(value));
25
+ }
26
+ Event.filter = filter;
27
+ })(Event = FieldModel.Event || (FieldModel.Event = {}));
28
+ })(FieldModel || (exports.FieldModel = FieldModel = {}));
@@ -0,0 +1,13 @@
1
+ import * as Schema from '../../schema';
2
+ import { EventBus } from '../../services';
3
+ import { FieldModel } from './FieldModel';
4
+ export declare namespace FieldSerializer {
5
+ type DeserializeFieldArgs = {
6
+ id: string;
7
+ eventBus: EventBus;
8
+ schema: Schema.Field.Type;
9
+ content: any | undefined;
10
+ snapshot: any | undefined;
11
+ };
12
+ function deserializeField({ id, eventBus, schema, content, snapshot }: DeserializeFieldArgs): FieldModel;
13
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldSerializer = void 0;
4
+ const errors_1 = require("../../errors");
5
+ const Field_1 = require("./Field");
6
+ const FieldList_1 = require("./FieldList");
7
+ const ObjectField_1 = require("./ObjectField");
8
+ // namespace
9
+ var FieldSerializer;
10
+ (function (FieldSerializer) {
11
+ function deserializeField({ id, eventBus, schema, content, snapshot }) {
12
+ var _a;
13
+ // deserialize based on type
14
+ switch (schema.type) {
15
+ // unpack a simple field
16
+ case 'text':
17
+ case 'richtext':
18
+ case 'enum':
19
+ case 'boolean':
20
+ case 'date':
21
+ case 'timestamp':
22
+ case 'link':
23
+ case 'embedded.video':
24
+ case 'asset':
25
+ case 'dynamic.pages':
26
+ case 'collection':
27
+ case 'page':
28
+ return new Field_1.Field({
29
+ eventBus,
30
+ schema,
31
+ id,
32
+ name: schema.name,
33
+ publishedValue: snapshot !== null && snapshot !== void 0 ? snapshot : undefined,
34
+ initialValue: content !== null && content !== void 0 ? content : undefined,
35
+ required: schema.required
36
+ });
37
+ // handle lists (may nest more complex types)
38
+ case 'list': {
39
+ // fail if we don't have any types in the list
40
+ const itemSchemas = Object.entries(schema.itemTypes);
41
+ if (itemSchemas.length === 0) {
42
+ throw new errors_1.IllegalStateError(`ListField "${schema.name}" is defined without any itemTypes entries`);
43
+ }
44
+ // return list
45
+ return new FieldList_1.FieldList({
46
+ eventBus,
47
+ schema: schema,
48
+ id,
49
+ name: schema.name,
50
+ publishedValue: snapshot !== null && snapshot !== void 0 ? snapshot : undefined,
51
+ initialValue: content !== null && content !== void 0 ? content : undefined,
52
+ required: schema.required
53
+ });
54
+ }
55
+ // or unpack a complex type (aka an object)
56
+ case 'object':
57
+ return new ObjectField_1.ObjectField({
58
+ eventBus,
59
+ schema,
60
+ id,
61
+ name: schema.name,
62
+ publishedValue: snapshot !== null && snapshot !== void 0 ? snapshot : undefined,
63
+ initialValue: content !== null && content !== void 0 ? content : undefined,
64
+ required: schema.required
65
+ });
66
+ default:
67
+ throw new errors_1.NotImplementedError(`Unsupported content type for block field "${id}": ${(_a = schema.type) !== null && _a !== void 0 ? _a : 'Unknown'}`);
68
+ }
69
+ }
70
+ FieldSerializer.deserializeField = deserializeField;
71
+ })(FieldSerializer || (exports.FieldSerializer = FieldSerializer = {}));