mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 13:05:08 +09:00
## Description ref #877 As a part of above I'm changing ``` export const ImageValue = z.object({ type: z.literal("image"), value: z.array(z.object({ type: z.literal("asset"), value: ImageAsset })), }); ``` to ``` export const ImageValue = z.object({ type: z.literal("image"), value: z.object({ type: z.literal("asset"), value: ImageAsset }), }); ``` In favour of using in next PRs ``` const ArrayValue = z.object({ type: z.literal("array"), value: z.array(z.union([UnitValue, KeywordValue, UnparsedValue, ImageValue])), }); ``` For now, to not break compatibility with existing code I'm not converting to an array immediately. Just style types simplification. 'array' type is not now supported on db level, parse/serialize will not work. Will be done in following PRs ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @TrySound , I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 5de6) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env.example` and the `builder/env-check.js` if mandatory