@qwickapps/react-framework 1.4.0 → 1.4.2

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 (486) hide show
  1. package/QUICK_START_GUIDE.md +82 -0
  2. package/README.md +231 -21
  3. package/dist/components/Html.d.ts.map +1 -1
  4. package/dist/components/Markdown.d.ts +1 -2
  5. package/dist/components/Markdown.d.ts.map +1 -1
  6. package/dist/components/SafeSpan.d.ts +1 -2
  7. package/dist/components/SafeSpan.d.ts.map +1 -1
  8. package/dist/components/base/Container.d.ts +32 -0
  9. package/dist/components/base/Container.d.ts.map +1 -0
  10. package/dist/components/base/ContainerView.d.ts +65 -0
  11. package/dist/components/base/ContainerView.d.ts.map +1 -0
  12. package/dist/components/base/ModelView.d.ts +37 -46
  13. package/dist/components/base/ModelView.d.ts.map +1 -1
  14. package/dist/components/base/index.d.ts +3 -2
  15. package/dist/components/base/index.d.ts.map +1 -1
  16. package/dist/components/blocks/Article.d.ts +1 -2
  17. package/dist/components/blocks/Article.d.ts.map +1 -1
  18. package/dist/components/blocks/Code-factory.d.ts +22 -0
  19. package/dist/components/blocks/Code-factory.d.ts.map +1 -0
  20. package/dist/components/blocks/Code-old.d.ts +31 -0
  21. package/dist/components/blocks/Code-old.d.ts.map +1 -0
  22. package/dist/components/blocks/Code.d.ts +30 -18
  23. package/dist/components/blocks/Code.d.ts.map +1 -1
  24. package/dist/components/blocks/HeroBlock.d.ts +1 -2
  25. package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
  26. package/dist/components/blocks/Image.d.ts +1 -2
  27. package/dist/components/blocks/Image.d.ts.map +1 -1
  28. package/dist/components/blocks/Section.d.ts +1 -2
  29. package/dist/components/blocks/Section.d.ts.map +1 -1
  30. package/dist/components/blocks/Text.d.ts +35 -27
  31. package/dist/components/blocks/Text.d.ts.map +1 -1
  32. package/dist/components/buttons/Button.d.ts +1 -2
  33. package/dist/components/buttons/Button.d.ts.map +1 -1
  34. package/dist/components/index.d.ts +2 -0
  35. package/dist/components/index.d.ts.map +1 -1
  36. package/dist/components/input/ChoiceInputField.d.ts +1 -2
  37. package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
  38. package/dist/components/input/HtmlInputField.d.ts +1 -2
  39. package/dist/components/input/HtmlInputField.d.ts.map +1 -1
  40. package/dist/components/input/SelectInputField.d.ts +1 -2
  41. package/dist/components/input/SelectInputField.d.ts.map +1 -1
  42. package/dist/components/pages/Page.d.ts +29 -47
  43. package/dist/components/pages/Page.d.ts.map +1 -1
  44. package/dist/components/pages/index.d.ts +2 -3
  45. package/dist/components/pages/index.d.ts.map +1 -1
  46. package/dist/components/shared/createSerializableView.d.ts +68 -0
  47. package/dist/components/shared/createSerializableView.d.ts.map +1 -0
  48. package/dist/components/shared/viewProps.d.ts +37 -0
  49. package/dist/components/shared/viewProps.d.ts.map +1 -0
  50. package/dist/index.esm.js +21782 -22580
  51. package/dist/index.js +21782 -22579
  52. package/dist/qa/ConsoleWarningTest.d.ts +5 -0
  53. package/dist/qa/ConsoleWarningTest.d.ts.map +1 -0
  54. package/dist/qa/StorageKeyTest.d.ts +6 -0
  55. package/dist/qa/StorageKeyTest.d.ts.map +1 -0
  56. package/dist/qa/ThemeStorageKeyTest.d.ts +6 -0
  57. package/dist/qa/ThemeStorageKeyTest.d.ts.map +1 -0
  58. package/dist/schemas/CodeSchema.d.ts +2 -2
  59. package/dist/schemas/CodeSchema.d.ts.map +1 -1
  60. package/dist/schemas/ContainerSchema.d.ts +12 -0
  61. package/dist/schemas/ContainerSchema.d.ts.map +1 -0
  62. package/dist/schemas/PageTemplateSchema.d.ts +3 -3
  63. package/dist/schemas/PageTemplateSchema.d.ts.map +1 -1
  64. package/dist/schemas/ViewModelSchema.d.ts +46 -6
  65. package/dist/schemas/ViewModelSchema.d.ts.map +1 -1
  66. package/dist/schemas/ViewSchema.d.ts +65 -0
  67. package/dist/schemas/ViewSchema.d.ts.map +1 -0
  68. package/dist/schemas/index.d.ts +1 -1
  69. package/dist/schemas/index.d.ts.map +1 -1
  70. package/dist/schemas/transformers/ComponentTransformer.d.ts +27 -15
  71. package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
  72. package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
  73. package/dist/schemas/transformers/registry.d.ts +3 -0
  74. package/dist/schemas/transformers/registry.d.ts.map +1 -1
  75. package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
  76. package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
  77. package/dist/src/components/AccessibilityChecker.d.ts +12 -0
  78. package/dist/src/components/AccessibilityChecker.d.ts.map +1 -0
  79. package/dist/src/components/AccessibilityProvider.d.ts +64 -0
  80. package/dist/src/components/AccessibilityProvider.d.ts.map +1 -0
  81. package/dist/src/components/Breadcrumbs.d.ts +39 -0
  82. package/dist/src/components/Breadcrumbs.d.ts.map +1 -0
  83. package/dist/src/components/ErrorBoundary.d.ts +46 -0
  84. package/dist/src/components/ErrorBoundary.d.ts.map +1 -0
  85. package/dist/src/components/Html.d.ts +58 -0
  86. package/dist/src/components/Html.d.ts.map +1 -0
  87. package/dist/src/components/Logo.d.ts +56 -0
  88. package/dist/src/components/Logo.d.ts.map +1 -0
  89. package/dist/src/components/Markdown.d.ts +51 -0
  90. package/dist/src/components/Markdown.d.ts.map +1 -0
  91. package/dist/src/components/QwickApp.d.ts +69 -0
  92. package/dist/src/components/QwickApp.d.ts.map +1 -0
  93. package/dist/src/components/QwickAppsLogo.d.ts +25 -0
  94. package/dist/src/components/QwickAppsLogo.d.ts.map +1 -0
  95. package/dist/src/components/QwickIcon.d.ts +23 -0
  96. package/dist/src/components/QwickIcon.d.ts.map +1 -0
  97. package/dist/src/components/ResponsiveMenu.d.ts +38 -0
  98. package/dist/src/components/ResponsiveMenu.d.ts.map +1 -0
  99. package/dist/src/components/SafeSpan.d.ts +29 -0
  100. package/dist/src/components/SafeSpan.d.ts.map +1 -0
  101. package/dist/src/components/Scaffold.d.ts +57 -0
  102. package/dist/src/components/Scaffold.d.ts.map +1 -0
  103. package/dist/src/components/base/Container.d.ts +33 -0
  104. package/dist/src/components/base/Container.d.ts.map +1 -0
  105. package/dist/src/components/base/ModelView.d.ts +92 -0
  106. package/dist/src/components/base/ModelView.d.ts.map +1 -0
  107. package/dist/src/components/base/index.d.ts +12 -0
  108. package/dist/src/components/base/index.d.ts.map +1 -0
  109. package/dist/src/components/blocks/Article.d.ts +32 -0
  110. package/dist/src/components/blocks/Article.d.ts.map +1 -0
  111. package/dist/src/components/blocks/CardListGrid.d.ts +23 -0
  112. package/dist/src/components/blocks/CardListGrid.d.ts.map +1 -0
  113. package/dist/src/components/blocks/Code.d.ts +37 -0
  114. package/dist/src/components/blocks/Code.d.ts.map +1 -0
  115. package/dist/src/components/blocks/Content.d.ts +24 -0
  116. package/dist/src/components/blocks/Content.d.ts.map +1 -0
  117. package/dist/src/components/blocks/CoverImageHeader.d.ts +44 -0
  118. package/dist/src/components/blocks/CoverImageHeader.d.ts.map +1 -0
  119. package/dist/src/components/blocks/FeatureCard.d.ts +66 -0
  120. package/dist/src/components/blocks/FeatureCard.d.ts.map +1 -0
  121. package/dist/src/components/blocks/FeatureGrid.d.ts +48 -0
  122. package/dist/src/components/blocks/FeatureGrid.d.ts.map +1 -0
  123. package/dist/src/components/blocks/Footer.d.ts +56 -0
  124. package/dist/src/components/blocks/Footer.d.ts.map +1 -0
  125. package/dist/src/components/blocks/HeroBlock.d.ts +55 -0
  126. package/dist/src/components/blocks/HeroBlock.d.ts.map +1 -0
  127. package/dist/src/components/blocks/Image.d.ts +40 -0
  128. package/dist/src/components/blocks/Image.d.ts.map +1 -0
  129. package/dist/src/components/blocks/PageBannerHeader.d.ts +30 -0
  130. package/dist/src/components/blocks/PageBannerHeader.d.ts.map +1 -0
  131. package/dist/src/components/blocks/ProductCard.d.ts +57 -0
  132. package/dist/src/components/blocks/ProductCard.d.ts.map +1 -0
  133. package/dist/src/components/blocks/Section.d.ts +45 -0
  134. package/dist/src/components/blocks/Section.d.ts.map +1 -0
  135. package/dist/src/components/blocks/Text.d.ts +34 -0
  136. package/dist/src/components/blocks/Text.d.ts.map +1 -0
  137. package/dist/src/components/blocks/index.d.ts +41 -0
  138. package/dist/src/components/blocks/index.d.ts.map +1 -0
  139. package/dist/src/components/buttons/Button.d.ts +41 -0
  140. package/dist/src/components/buttons/Button.d.ts.map +1 -0
  141. package/dist/src/components/buttons/PaletteSwitcher.d.ts +24 -0
  142. package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +1 -0
  143. package/dist/src/components/buttons/ThemeSwitcher.d.ts +24 -0
  144. package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +1 -0
  145. package/dist/src/components/buttons/index.d.ts +11 -0
  146. package/dist/src/components/buttons/index.d.ts.map +1 -0
  147. package/dist/src/components/forms/FormBlock.d.ts +51 -0
  148. package/dist/src/components/forms/FormBlock.d.ts.map +1 -0
  149. package/dist/src/components/forms/index.d.ts +8 -0
  150. package/dist/src/components/forms/index.d.ts.map +1 -0
  151. package/dist/src/components/index.d.ts +41 -0
  152. package/dist/src/components/index.d.ts.map +1 -0
  153. package/dist/src/components/input/ChoiceInputField.d.ts +29 -0
  154. package/dist/src/components/input/ChoiceInputField.d.ts.map +1 -0
  155. package/dist/src/components/input/HtmlInputField.d.ts +33 -0
  156. package/dist/src/components/input/HtmlInputField.d.ts.map +1 -0
  157. package/dist/src/components/input/SelectInputField.d.ts +31 -0
  158. package/dist/src/components/input/SelectInputField.d.ts.map +1 -0
  159. package/dist/src/components/input/SwitchInputField.d.ts +27 -0
  160. package/dist/src/components/input/SwitchInputField.d.ts.map +1 -0
  161. package/dist/src/components/input/TextField.d.ts +18 -0
  162. package/dist/src/components/input/TextField.d.ts.map +1 -0
  163. package/dist/src/components/input/TextInputField.d.ts +34 -0
  164. package/dist/src/components/input/TextInputField.d.ts.map +1 -0
  165. package/dist/src/components/input/index.d.ts +19 -0
  166. package/dist/src/components/input/index.d.ts.map +1 -0
  167. package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
  168. package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
  169. package/dist/src/components/layout/CollapsibleLayout/index.d.ts +9 -0
  170. package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
  171. package/dist/src/components/layout/GridCell.d.ts +32 -0
  172. package/dist/src/components/layout/GridCell.d.ts.map +1 -0
  173. package/dist/src/components/layout/GridCellWrapper.d.ts +46 -0
  174. package/dist/src/components/layout/GridCellWrapper.d.ts.map +1 -0
  175. package/dist/src/components/layout/GridLayout.d.ts +50 -0
  176. package/dist/src/components/layout/GridLayout.d.ts.map +1 -0
  177. package/dist/src/components/layout/index.d.ts +14 -0
  178. package/dist/src/components/layout/index.d.ts.map +1 -0
  179. package/dist/src/components/menu/Menu.d.ts +1 -0
  180. package/dist/src/components/menu/Menu.d.ts.map +1 -0
  181. package/dist/src/components/menu/MenuItem.d.ts +31 -0
  182. package/dist/src/components/menu/MenuItem.d.ts.map +1 -0
  183. package/dist/src/components/menu/index.d.ts +7 -0
  184. package/dist/src/components/menu/index.d.ts.map +1 -0
  185. package/dist/src/components/pages/FormPage.d.ts +66 -0
  186. package/dist/src/components/pages/FormPage.d.ts.map +1 -0
  187. package/dist/src/components/pages/Page.d.ts +68 -0
  188. package/dist/src/components/pages/Page.d.ts.map +1 -0
  189. package/dist/src/components/pages/index.d.ts +10 -0
  190. package/dist/src/components/pages/index.d.ts.map +1 -0
  191. package/dist/src/components/shared/createSerializableView.d.ts +81 -0
  192. package/dist/src/components/shared/createSerializableView.d.ts.map +1 -0
  193. package/dist/src/components/shared/viewProps.d.ts +37 -0
  194. package/dist/src/components/shared/viewProps.d.ts.map +1 -0
  195. package/dist/src/config/AppConfig.d.ts +49 -0
  196. package/dist/src/config/AppConfig.d.ts.map +1 -0
  197. package/dist/src/config/AppConfigBuilder.d.ts +75 -0
  198. package/dist/src/config/AppConfigBuilder.d.ts.map +1 -0
  199. package/dist/src/config/index.d.ts +13 -0
  200. package/dist/src/config/index.d.ts.map +1 -0
  201. package/dist/src/config/types.d.ts +130 -0
  202. package/dist/src/config/types.d.ts.map +1 -0
  203. package/dist/src/config.d.ts +15 -0
  204. package/dist/src/config.d.ts.map +1 -0
  205. package/dist/src/contexts/DataContext.d.ts +139 -0
  206. package/dist/src/contexts/DataContext.d.ts.map +1 -0
  207. package/dist/src/contexts/DimensionsContext.d.ts +42 -0
  208. package/dist/src/contexts/DimensionsContext.d.ts.map +1 -0
  209. package/dist/src/contexts/PaletteContext.d.ts +53 -0
  210. package/dist/src/contexts/PaletteContext.d.ts.map +1 -0
  211. package/dist/src/contexts/PrintModeContext.d.ts +27 -0
  212. package/dist/src/contexts/PrintModeContext.d.ts.map +1 -0
  213. package/dist/src/contexts/QwickAppContext.d.ts +71 -0
  214. package/dist/src/contexts/QwickAppContext.d.ts.map +1 -0
  215. package/dist/src/contexts/ThemeContext.d.ts +65 -0
  216. package/dist/src/contexts/ThemeContext.d.ts.map +1 -0
  217. package/dist/src/contexts/index.d.ts +11 -0
  218. package/dist/src/contexts/index.d.ts.map +1 -0
  219. package/dist/src/hooks/index.d.ts +12 -0
  220. package/dist/src/hooks/index.d.ts.map +1 -0
  221. package/dist/src/hooks/useBaseProps.d.ts +101 -0
  222. package/dist/src/hooks/useBaseProps.d.ts.map +1 -0
  223. package/dist/src/hooks/useDataBinding.d.ts +22 -0
  224. package/dist/src/hooks/useDataBinding.d.ts.map +1 -0
  225. package/dist/src/hooks/usePrintMode.d.ts +39 -0
  226. package/dist/src/hooks/usePrintMode.d.ts.map +1 -0
  227. package/dist/src/index.d.ts +9 -0
  228. package/dist/src/index.d.ts.map +1 -0
  229. package/dist/src/palettes/PaletteAutumn.d.ts +10 -0
  230. package/dist/src/palettes/PaletteAutumn.d.ts.map +1 -0
  231. package/dist/src/palettes/PaletteCosmic.d.ts +10 -0
  232. package/dist/src/palettes/PaletteCosmic.d.ts.map +1 -0
  233. package/dist/src/palettes/PaletteDefault.d.ts +10 -0
  234. package/dist/src/palettes/PaletteDefault.d.ts.map +1 -0
  235. package/dist/src/palettes/PaletteOcean.d.ts +10 -0
  236. package/dist/src/palettes/PaletteOcean.d.ts.map +1 -0
  237. package/dist/src/palettes/PaletteSpring.d.ts +10 -0
  238. package/dist/src/palettes/PaletteSpring.d.ts.map +1 -0
  239. package/dist/src/palettes/PaletteWinter.d.ts +10 -0
  240. package/dist/src/palettes/PaletteWinter.d.ts.map +1 -0
  241. package/dist/src/palettes/index.d.ts +13 -0
  242. package/dist/src/palettes/index.d.ts.map +1 -0
  243. package/dist/src/schemas/ActionSchema.d.ts +21 -0
  244. package/dist/src/schemas/ActionSchema.d.ts.map +1 -0
  245. package/dist/src/schemas/ArticleSchema.d.ts +13 -0
  246. package/dist/src/schemas/ArticleSchema.d.ts.map +1 -0
  247. package/dist/src/schemas/ButtonSchema.d.ts +19 -0
  248. package/dist/src/schemas/ButtonSchema.d.ts.map +1 -0
  249. package/dist/src/schemas/CardListGridSchema.d.ts +17 -0
  250. package/dist/src/schemas/CardListGridSchema.d.ts.map +1 -0
  251. package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +18 -0
  252. package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
  253. package/dist/src/schemas/CodeSchema.d.ts +18 -0
  254. package/dist/src/schemas/CodeSchema.d.ts.map +1 -0
  255. package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +32 -0
  256. package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
  257. package/dist/src/schemas/ContainerSchema.d.ts +12 -0
  258. package/dist/src/schemas/ContainerSchema.d.ts.map +1 -0
  259. package/dist/src/schemas/ContentSchema.d.ts +21 -0
  260. package/dist/src/schemas/ContentSchema.d.ts.map +1 -0
  261. package/dist/src/schemas/CoverImageHeaderSchema.d.ts +28 -0
  262. package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
  263. package/dist/src/schemas/FeatureCardSchema.d.ts +28 -0
  264. package/dist/src/schemas/FeatureCardSchema.d.ts.map +1 -0
  265. package/dist/src/schemas/FeatureGridSchema.d.ts +17 -0
  266. package/dist/src/schemas/FeatureGridSchema.d.ts.map +1 -0
  267. package/dist/src/schemas/FeatureItemSchema.d.ts +16 -0
  268. package/dist/src/schemas/FeatureItemSchema.d.ts.map +1 -0
  269. package/dist/src/schemas/FooterItemSchema.d.ts +15 -0
  270. package/dist/src/schemas/FooterItemSchema.d.ts.map +1 -0
  271. package/dist/src/schemas/FooterSchema.d.ts +20 -0
  272. package/dist/src/schemas/FooterSchema.d.ts.map +1 -0
  273. package/dist/src/schemas/FooterSectionSchema.d.ts +15 -0
  274. package/dist/src/schemas/FooterSectionSchema.d.ts.map +1 -0
  275. package/dist/src/schemas/FormBlockSchema.d.ts +19 -0
  276. package/dist/src/schemas/FormBlockSchema.d.ts.map +1 -0
  277. package/dist/src/schemas/GridCellSchema.d.ts +23 -0
  278. package/dist/src/schemas/GridCellSchema.d.ts.map +1 -0
  279. package/dist/src/schemas/GridLayoutSchema.d.ts +21 -0
  280. package/dist/src/schemas/GridLayoutSchema.d.ts.map +1 -0
  281. package/dist/src/schemas/HeaderActionSchema.d.ts +17 -0
  282. package/dist/src/schemas/HeaderActionSchema.d.ts.map +1 -0
  283. package/dist/src/schemas/HeroBlockSchema.d.ts +22 -0
  284. package/dist/src/schemas/HeroBlockSchema.d.ts.map +1 -0
  285. package/dist/src/schemas/HtmlInputFieldSchema.d.ts +18 -0
  286. package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
  287. package/dist/src/schemas/HtmlSchema.d.ts +14 -0
  288. package/dist/src/schemas/HtmlSchema.d.ts.map +1 -0
  289. package/dist/src/schemas/ImageSchema.d.ts +32 -0
  290. package/dist/src/schemas/ImageSchema.d.ts.map +1 -0
  291. package/dist/src/schemas/LogoSchema.d.ts +35 -0
  292. package/dist/src/schemas/LogoSchema.d.ts.map +1 -0
  293. package/dist/src/schemas/MarkdownSchema.d.ts +14 -0
  294. package/dist/src/schemas/MarkdownSchema.d.ts.map +1 -0
  295. package/dist/src/schemas/MetadataItemSchema.d.ts +13 -0
  296. package/dist/src/schemas/MetadataItemSchema.d.ts.map +1 -0
  297. package/dist/src/schemas/PageBannerHeaderSchema.d.ts +28 -0
  298. package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
  299. package/dist/src/schemas/PageTemplateSchema.d.ts +31 -0
  300. package/dist/src/schemas/PageTemplateSchema.d.ts.map +1 -0
  301. package/dist/src/schemas/PaletteSwitcherSchema.d.ts +16 -0
  302. package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
  303. package/dist/src/schemas/PrintConfigSchema.d.ts +31 -0
  304. package/dist/src/schemas/PrintConfigSchema.d.ts.map +1 -0
  305. package/dist/src/schemas/ProductCardSchema.d.ts +39 -0
  306. package/dist/src/schemas/ProductCardSchema.d.ts.map +1 -0
  307. package/dist/src/schemas/SafeSpanSchema.d.ts +13 -0
  308. package/dist/src/schemas/SafeSpanSchema.d.ts.map +1 -0
  309. package/dist/src/schemas/SectionSchema.d.ts +16 -0
  310. package/dist/src/schemas/SectionSchema.d.ts.map +1 -0
  311. package/dist/src/schemas/SelectInputFieldSchema.d.ts +27 -0
  312. package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +1 -0
  313. package/dist/src/schemas/SwitchInputFieldSchema.d.ts +18 -0
  314. package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
  315. package/dist/src/schemas/TextInputFieldSchema.d.ts +22 -0
  316. package/dist/src/schemas/TextInputFieldSchema.d.ts.map +1 -0
  317. package/dist/src/schemas/TextSchema.d.ts +37 -0
  318. package/dist/src/schemas/TextSchema.d.ts.map +1 -0
  319. package/dist/src/schemas/ThemeSwitcherSchema.d.ts +19 -0
  320. package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
  321. package/dist/src/schemas/ViewSchema.d.ts +66 -0
  322. package/dist/src/schemas/ViewSchema.d.ts.map +1 -0
  323. package/dist/src/schemas/index.d.ts +47 -0
  324. package/dist/src/schemas/index.d.ts.map +1 -0
  325. package/dist/src/schemas/transformers/ComponentTransformer.d.ts +128 -0
  326. package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
  327. package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
  328. package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
  329. package/dist/src/schemas/transformers/registry.d.ts +18 -0
  330. package/dist/src/schemas/transformers/registry.d.ts.map +1 -0
  331. package/dist/src/schemas/types/Serializable.d.ts +46 -0
  332. package/dist/src/schemas/types/Serializable.d.ts.map +1 -0
  333. package/dist/src/stories/_templates/SerializationTemplate.d.ts +44 -0
  334. package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +1 -0
  335. package/dist/src/templates/TemplateResolver.d.ts +52 -0
  336. package/dist/src/templates/TemplateResolver.d.ts.map +1 -0
  337. package/dist/src/templates/index.d.ts +7 -0
  338. package/dist/src/templates/index.d.ts.map +1 -0
  339. package/dist/src/types/CacheProvider.d.ts +18 -0
  340. package/dist/src/types/CacheProvider.d.ts.map +1 -0
  341. package/dist/src/types/CollapsibleLayout.d.ts +142 -0
  342. package/dist/src/types/CollapsibleLayout.d.ts.map +1 -0
  343. package/dist/src/types/ContentProxy.d.ts +47 -0
  344. package/dist/src/types/ContentProxy.d.ts.map +1 -0
  345. package/dist/src/types/DataTypes.d.ts +185 -0
  346. package/dist/src/types/DataTypes.d.ts.map +1 -0
  347. package/dist/src/types/TemplateProvider.d.ts +10 -0
  348. package/dist/src/types/TemplateProvider.d.ts.map +1 -0
  349. package/dist/src/types/TemplateResolver.d.ts +23 -0
  350. package/dist/src/types/TemplateResolver.d.ts.map +1 -0
  351. package/dist/src/types/index.d.ts +82 -0
  352. package/dist/src/types/index.d.ts.map +1 -0
  353. package/dist/src/utils/breakpoints.d.ts +35 -0
  354. package/dist/src/utils/breakpoints.d.ts.map +1 -0
  355. package/dist/src/utils/cssUtils.d.ts +17 -0
  356. package/dist/src/utils/cssUtils.d.ts.map +1 -0
  357. package/dist/src/utils/customPaletteManager.d.ts +8 -0
  358. package/dist/src/utils/customPaletteManager.d.ts.map +1 -0
  359. package/dist/src/utils/dimensions.d.ts +34 -0
  360. package/dist/src/utils/dimensions.d.ts.map +1 -0
  361. package/dist/src/utils/htmlTransform.d.ts +44 -0
  362. package/dist/src/utils/htmlTransform.d.ts.map +1 -0
  363. package/dist/src/utils/index.d.ts +16 -0
  364. package/dist/src/utils/index.d.ts.map +1 -0
  365. package/dist/src/utils/logger.d.ts +26 -0
  366. package/dist/src/utils/logger.d.ts.map +1 -0
  367. package/dist/src/utils/paletteUtils.d.ts +38 -0
  368. package/dist/src/utils/paletteUtils.d.ts.map +1 -0
  369. package/dist/src/utils/persistenceUtils.d.ts +31 -0
  370. package/dist/src/utils/persistenceUtils.d.ts.map +1 -0
  371. package/dist/src/utils/reactUtils.d.ts +33 -0
  372. package/dist/src/utils/reactUtils.d.ts.map +1 -0
  373. package/dist/src/utils/spacing.d.ts +34 -0
  374. package/dist/src/utils/spacing.d.ts.map +1 -0
  375. package/dist/src/utils/themePerformanceMonitor.d.ts +32 -0
  376. package/dist/src/utils/themePerformanceMonitor.d.ts.map +1 -0
  377. package/dist/src/utils/themeUtils.d.ts +27 -0
  378. package/dist/src/utils/themeUtils.d.ts.map +1 -0
  379. package/dist/utils/cssUtils.d.ts +17 -0
  380. package/dist/utils/cssUtils.d.ts.map +1 -0
  381. package/dist/utils/index.d.ts +1 -0
  382. package/dist/utils/index.d.ts.map +1 -1
  383. package/package.json +5 -2
  384. package/scripts/bundle-css.cjs +27 -0
  385. package/scripts/create-project.sh +28 -0
  386. package/scripts/create-qwickapps-project.js +284 -0
  387. package/src/__tests__/components/base/Container.test.tsx +966 -0
  388. package/src/__tests__/schemas/PageTemplateSchema.test.ts +1 -1
  389. package/src/__tests__/schemas/ViewSchema.test.ts +805 -0
  390. package/src/__tests__/schemas/builders.test.ts +2 -2
  391. package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +19 -19
  392. package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +13 -13
  393. package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +39 -39
  394. package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +14 -14
  395. package/src/__tests__/schemas/transformers/TestAutomation.test.ts +8 -8
  396. package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +181 -0
  397. package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +458 -0
  398. package/src/__tests__/test_image_accessibility.test.tsx +226 -0
  399. package/src/__tests__/utils/optional-logging.test.ts +3 -3
  400. package/src/components/Html.tsx +24 -15
  401. package/src/components/Logo.tsx +2 -2
  402. package/src/components/Markdown.tsx +2 -7
  403. package/src/components/SafeSpan.tsx +2 -7
  404. package/src/components/base/Container.tsx +61 -0
  405. package/src/components/base/ModelView.tsx +225 -91
  406. package/src/components/base/index.ts +3 -2
  407. package/src/components/blocks/Article.tsx +2 -7
  408. package/src/components/blocks/CardListGrid.tsx +2 -2
  409. package/src/components/blocks/Code.tsx +91 -179
  410. package/src/components/blocks/Content.tsx +2 -2
  411. package/src/components/blocks/CoverImageHeader.tsx +2 -2
  412. package/src/components/blocks/HeroBlock.tsx +54 -146
  413. package/src/components/blocks/Image.tsx +82 -196
  414. package/src/components/blocks/PageBannerHeader.tsx +2 -2
  415. package/src/components/blocks/Section.tsx +79 -181
  416. package/src/components/blocks/Text.tsx +100 -198
  417. package/src/components/buttons/Button.tsx +85 -183
  418. package/src/components/buttons/PaletteSwitcher.tsx +2 -2
  419. package/src/components/buttons/ThemeSwitcher.tsx +2 -2
  420. package/src/components/forms/FormBlock.tsx +2 -2
  421. package/src/components/index.ts +5 -0
  422. package/src/components/input/ChoiceInputField.tsx +76 -160
  423. package/src/components/input/HtmlInputField.tsx +141 -264
  424. package/src/components/input/SelectInputField.tsx +48 -153
  425. package/src/components/input/SwitchInputField.tsx +41 -139
  426. package/src/components/input/TextInputField.tsx +39 -116
  427. package/src/components/layout/GridCell.tsx +36 -122
  428. package/src/components/layout/GridLayout.tsx +55 -127
  429. package/src/components/pages/Page.tsx +268 -276
  430. package/src/components/pages/index.ts +2 -3
  431. package/src/components/shared/createSerializableView.tsx +280 -0
  432. package/src/components/shared/viewProps.ts +207 -0
  433. package/src/config/__tests__/AppConfigBuilder.test.ts +2 -2
  434. package/src/contexts/DataContext.tsx +1 -1
  435. package/src/schemas/ButtonSchema.ts +3 -2
  436. package/src/schemas/CardListGridSchema.ts +3 -2
  437. package/src/schemas/ChoiceInputFieldSchema.ts +3 -2
  438. package/src/schemas/CodeSchema.ts +8 -6
  439. package/src/schemas/ContainerSchema.ts +25 -0
  440. package/src/schemas/FeatureCardSchema.ts +1 -1
  441. package/src/schemas/FormBlockSchema.ts +3 -2
  442. package/src/schemas/GridCellSchema.ts +4 -10
  443. package/src/schemas/GridLayoutSchema.ts +8 -14
  444. package/src/schemas/HeroBlockSchema.ts +3 -2
  445. package/src/schemas/HtmlInputFieldSchema.ts +3 -2
  446. package/src/schemas/ImageSchema.ts +3 -2
  447. package/src/schemas/PageTemplateSchema.ts +5 -5
  448. package/src/schemas/SectionSchema.ts +4 -12
  449. package/src/schemas/SelectInputFieldSchema.ts +3 -2
  450. package/src/schemas/SwitchInputFieldSchema.ts +2 -2
  451. package/src/schemas/TextInputFieldSchema.ts +3 -2
  452. package/src/schemas/ViewSchema.ts +570 -0
  453. package/src/schemas/index.ts +1 -1
  454. package/src/schemas/transformers/ComponentTransformer.ts +185 -163
  455. package/src/schemas/transformers/ReactNodeTransformer.ts +31 -28
  456. package/src/schemas/transformers/registry.ts +17 -10
  457. package/src/stories/Button.stories.tsx +24 -0
  458. package/src/stories/ChoiceInputField.stories.tsx +28 -1
  459. package/src/stories/Code.stories.tsx +61 -1
  460. package/src/stories/Container.stories.tsx +954 -0
  461. package/src/stories/FormBlock.stories.tsx +54 -0
  462. package/src/stories/FormComponents.stories.tsx +8 -13
  463. package/src/stories/GridCell.stories.tsx +23 -64
  464. package/src/stories/GridLayout.stories.tsx +22 -47
  465. package/src/stories/HeroBlock.stories.tsx +28 -0
  466. package/src/stories/HtmlInputField.stories.tsx +23 -1
  467. package/src/stories/Image.stories.tsx +45 -233
  468. package/src/stories/Markdown.stories.tsx +1 -1
  469. package/src/stories/Section.stories.tsx +38 -4
  470. package/src/stories/SelectInputField.stories.tsx +26 -1
  471. package/src/stories/Text.stories.tsx +22 -54
  472. package/src/stories/TextInputField.stories.tsx +24 -1
  473. package/src/stories/_templates/SerializationTemplate.tsx +165 -0
  474. package/src/templates/TemplateResolver.ts +2 -2
  475. package/src/types/CollapsibleLayout.ts +2 -2
  476. package/src/utils/cssUtils.ts +49 -0
  477. package/src/utils/index.ts +1 -0
  478. package/src/utils/logger.ts +13 -13
  479. package/src/__tests__/components/base/ModelView.test.tsx +0 -220
  480. package/src/__tests__/schemas/ViewModelSchema.test.ts +0 -80
  481. package/src/components/blocks/Code.md +0 -529
  482. package/src/schemas/README.md +0 -661
  483. package/src/schemas/ViewModelSchema.ts +0 -115
  484. package/src/tests/ConsoleWarningTest.tsx +0 -30
  485. package/src/tests/StorageKeyTest.tsx +0 -110
  486. package/src/tests/ThemeStorageKeyTest.tsx +0 -114
@@ -0,0 +1,458 @@
1
+ /**
2
+ * Round-trip Component Serialization Tests
3
+ *
4
+ * Comprehensive tests for Container, Text, and Code components
5
+ * to verify complete serialization/deserialization integrity.
6
+ * These are the components migrated to the new schema-driven architecture.
7
+ */
8
+
9
+ import React from 'react';
10
+ import { Container } from '../../../components/base/Container';
11
+ import { Text } from '../../../components/blocks/Text';
12
+ import { Code } from '../../../components/blocks/Code';
13
+ import { ComponentTransformer } from '../../../schemas/transformers/ComponentTransformer';
14
+ import '../../../schemas/transformers/registry'; // Ensure components are registered
15
+
16
+ describe('Round-trip Component Serialization', () => {
17
+
18
+ describe('Container Component', () => {
19
+ it('should perform perfect round-trip with basic props', () => {
20
+ const original = (
21
+ <Container
22
+ span={6}
23
+ padding="medium"
24
+ background="primary.main"
25
+ className="test-container"
26
+ >
27
+ Simple container content
28
+ </Container>
29
+ );
30
+
31
+ // Round-trip test
32
+ const firstSerialization = ComponentTransformer.serialize(original);
33
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
34
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
35
+
36
+ // Verify identical serializations
37
+ expect(firstSerialization).toBe(secondSerialization);
38
+
39
+ // Verify structure integrity
40
+ const parsed = JSON.parse(firstSerialization);
41
+ expect(parsed.tagName).toBe('Container');
42
+ expect(parsed.version).toBe('1.0.0');
43
+ expect(parsed.data.span).toBe(6);
44
+ expect(parsed.data.padding).toBe('medium');
45
+ expect(parsed.data.background).toBe('primary.main');
46
+ expect(parsed.data.className).toBe('test-container');
47
+ expect(parsed.data.children).toBe('Simple container content');
48
+ });
49
+
50
+ it('should perform perfect round-trip with event handlers', () => {
51
+ const original = (
52
+ <Container
53
+ span={8}
54
+ padding="large"
55
+ onClick={(event) => { console.log("Container clicked"); }}
56
+ onMouseEnter={(event) => { console.log("Mouse entered"); }}
57
+ >
58
+ Interactive container
59
+ </Container>
60
+ );
61
+
62
+ // Round-trip test
63
+ const firstSerialization = ComponentTransformer.serialize(original);
64
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
65
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
66
+
67
+ // Verify identical serializations
68
+ expect(firstSerialization).toBe(secondSerialization);
69
+
70
+ // Verify event handlers are preserved as strings
71
+ const parsed = JSON.parse(firstSerialization);
72
+ expect(typeof parsed.data.onClick).toBe('string');
73
+ expect(parsed.data.onClick).toContain('console.log("Container clicked")');
74
+ expect(typeof parsed.data.onMouseEnter).toBe('string');
75
+ expect(parsed.data.onMouseEnter).toContain('console.log("Mouse entered")');
76
+ });
77
+
78
+ it('should perform perfect round-trip with nested components', () => {
79
+ const original = (
80
+ <Container span={12} padding="large" background="secondary.main">
81
+ <Container span={6} padding="small">
82
+ <Text variant="h6">Nested text</Text>
83
+ </Container>
84
+ <Text variant="body1">Sibling text</Text>
85
+ </Container>
86
+ );
87
+
88
+ // Round-trip test
89
+ const firstSerialization = ComponentTransformer.serialize(original);
90
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
91
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
92
+
93
+ // Verify identical serializations
94
+ expect(firstSerialization).toBe(secondSerialization);
95
+
96
+ // Verify nested structure
97
+ const parsed = JSON.parse(firstSerialization);
98
+ expect(Array.isArray(parsed.data.children)).toBe(true);
99
+ expect(parsed.data.children).toHaveLength(2);
100
+
101
+ // First child is nested Container
102
+ const firstChild = parsed.data.children[0];
103
+ expect(firstChild.tagName).toBe('Container');
104
+ expect(firstChild.data.span).toBe(6);
105
+ expect(firstChild.data.children.tagName).toBe('Text');
106
+ expect(firstChild.data.children.data.variant).toBe('h6');
107
+ expect(firstChild.data.children.data.content).toBe('Nested text');
108
+
109
+ // Second child is Text
110
+ const secondChild = parsed.data.children[1];
111
+ expect(secondChild.tagName).toBe('Text');
112
+ expect(secondChild.data.variant).toBe('body1');
113
+ expect(secondChild.data.content).toBe('Sibling text');
114
+ });
115
+ });
116
+
117
+ describe('Text Component', () => {
118
+ it('should perform perfect round-trip with basic props', () => {
119
+ const original = (
120
+ <Text
121
+ variant="h4"
122
+ color="primary"
123
+ textAlign="center"
124
+ className="test-text"
125
+ >
126
+ Sample text content
127
+ </Text>
128
+ );
129
+
130
+ // Round-trip test
131
+ const firstSerialization = ComponentTransformer.serialize(original);
132
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
133
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
134
+
135
+ // Verify identical serializations
136
+ expect(firstSerialization).toBe(secondSerialization);
137
+
138
+ // Verify structure integrity
139
+ const parsed = JSON.parse(firstSerialization);
140
+ expect(parsed.tagName).toBe('Text');
141
+ expect(parsed.version).toBe('1.0.0');
142
+ expect(parsed.data.variant).toBe('h4');
143
+ expect(parsed.data.color).toBe('primary');
144
+ expect(parsed.data.textAlign).toBe('center');
145
+ expect(parsed.data.className).toBe('test-text');
146
+ expect(parsed.data.content).toBe('Sample text content');
147
+ });
148
+
149
+ it('should perform perfect round-trip with MUI sx props', () => {
150
+ const original = (
151
+ <Text
152
+ variant="body1"
153
+ sx={{ fontWeight: 'bold', marginTop: 2 }}
154
+ >
155
+ Styled text
156
+ </Text>
157
+ );
158
+
159
+ // Round-trip test
160
+ const firstSerialization = ComponentTransformer.serialize(original);
161
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
162
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
163
+
164
+ // Verify identical serializations
165
+ expect(firstSerialization).toBe(secondSerialization);
166
+
167
+ // Verify sx prop is preserved
168
+ const parsed = JSON.parse(firstSerialization);
169
+ expect(parsed.data.sx).toEqual({ fontWeight: 'bold', marginTop: 2 });
170
+ });
171
+
172
+ it('should perform perfect round-trip with event handlers', () => {
173
+ const original = (
174
+ <Text
175
+ variant="button"
176
+ onClick={(event) => { alert("Text clicked"); }}
177
+ style={{ cursor: 'pointer' }}
178
+ >
179
+ Clickable text
180
+ </Text>
181
+ );
182
+
183
+ // Round-trip test
184
+ const firstSerialization = ComponentTransformer.serialize(original);
185
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
186
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
187
+
188
+ // Verify identical serializations
189
+ expect(firstSerialization).toBe(secondSerialization);
190
+
191
+ // Verify event handler and style preservation
192
+ const parsed = JSON.parse(firstSerialization);
193
+ expect(typeof parsed.data.onClick).toBe('string');
194
+ expect(parsed.data.onClick).toContain('alert("Text clicked")');
195
+ expect(parsed.data.style).toEqual({ cursor: 'pointer' });
196
+ });
197
+ });
198
+
199
+ describe('Code Component', () => {
200
+ it('should perform perfect round-trip with basic props', () => {
201
+ const original = (
202
+ <Code
203
+ language="javascript"
204
+ title="Sample Code"
205
+ showLineNumbers={true}
206
+ showCopy={true}
207
+ >
208
+ const message = "Hello World";
209
+ console.log(message);
210
+ </Code>
211
+ );
212
+
213
+ // Round-trip test
214
+ const firstSerialization = ComponentTransformer.serialize(original);
215
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
216
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
217
+
218
+ // Verify identical serializations
219
+ expect(firstSerialization).toBe(secondSerialization);
220
+
221
+ // Verify structure integrity
222
+ const parsed = JSON.parse(firstSerialization);
223
+ expect(parsed.tagName).toBe('Code');
224
+ expect(parsed.version).toBe('1.0.0');
225
+ expect(parsed.data.language).toBe('javascript');
226
+ expect(parsed.data.title).toBe('Sample Code');
227
+ expect(parsed.data.showLineNumbers).toBe(true);
228
+ expect(parsed.data.showCopy).toBe(true);
229
+ expect(parsed.data.content).toContain('const message = "Hello World"');
230
+ });
231
+
232
+ it('should perform perfect round-trip with theme and styling', () => {
233
+ const original = (
234
+ <Code
235
+ language="typescript"
236
+ wrapLines={true}
237
+ codeBackground="dark"
238
+ className="custom-code"
239
+ style={{ borderRadius: '8px' }}
240
+ >
241
+ {`interface User {
242
+ name: string;
243
+ email: string;
244
+ }`}
245
+ </Code>
246
+ );
247
+
248
+ // Round-trip test
249
+ const firstSerialization = ComponentTransformer.serialize(original);
250
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
251
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
252
+
253
+ // Verify identical serializations
254
+ expect(firstSerialization).toBe(secondSerialization);
255
+
256
+ // Verify all props are preserved
257
+ const parsed = JSON.parse(firstSerialization);
258
+ expect(parsed.data.language).toBe('typescript');
259
+ expect(parsed.data.wrapLines).toBe(true);
260
+ expect(parsed.data.codeBackground).toBe('dark');
261
+ expect(parsed.data.className).toBe('custom-code');
262
+ expect(parsed.data.style).toEqual({ borderRadius: '8px' });
263
+ expect(parsed.data.content).toContain('interface User');
264
+ });
265
+ });
266
+
267
+ describe('Complex Mixed Component Trees', () => {
268
+ it('should perform perfect round-trip with deeply nested mixed components', () => {
269
+ const original = (
270
+ <Container span={12} padding="large" background="background.paper">
271
+ <Text variant="h3" textAlign="center" marginBottom="large">
272
+ Documentation Section
273
+ </Text>
274
+
275
+ <Container span={8} padding="medium">
276
+ <Text variant="h5" color="primary">
277
+ Code Example:
278
+ </Text>
279
+
280
+ <Code
281
+ language="jsx"
282
+ title="React Component Example"
283
+ showLineNumbers={true}
284
+ >
285
+ {`function MyComponent() {
286
+ return (
287
+ <Container span={6}>
288
+ <Text variant="body1">Hello World</Text>
289
+ </Container>
290
+ );
291
+ }`}
292
+ </Code>
293
+
294
+ <Text variant="body2" color="textSecondary" marginTop="medium">
295
+ This example shows a basic React component structure.
296
+ </Text>
297
+ </Container>
298
+
299
+ <Container span={4} padding="small" background="grey.100">
300
+ <Text variant="h6">Sidebar Content</Text>
301
+ <Text variant="body2">Additional information here.</Text>
302
+ </Container>
303
+ </Container>
304
+ );
305
+
306
+ // Round-trip test
307
+ const firstSerialization = ComponentTransformer.serialize(original);
308
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
309
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
310
+
311
+ // Verify identical serializations
312
+ expect(firstSerialization).toBe(secondSerialization);
313
+
314
+ // Verify complex structure integrity
315
+ const parsed = JSON.parse(firstSerialization);
316
+ expect(parsed.tagName).toBe('Container');
317
+ expect(Array.isArray(parsed.data.children)).toBe(true);
318
+ expect(parsed.data.children).toHaveLength(3);
319
+
320
+ // Verify first child (Text heading)
321
+ const heading = parsed.data.children[0];
322
+ expect(heading.tagName).toBe('Text');
323
+ expect(heading.data.variant).toBe('h3');
324
+ expect(heading.data.content).toBe('Documentation Section');
325
+
326
+ // Verify second child (Container with nested components)
327
+ const mainContent = parsed.data.children[1];
328
+ expect(mainContent.tagName).toBe('Container');
329
+ expect(mainContent.data.span).toBe(8);
330
+ expect(Array.isArray(mainContent.data.children)).toBe(true);
331
+ expect(mainContent.data.children).toHaveLength(3);
332
+
333
+ // Verify nested Code component
334
+ const codeComponent = mainContent.data.children[1];
335
+ expect(codeComponent.tagName).toBe('Code');
336
+ expect(codeComponent.data.language).toBe('jsx');
337
+ expect(codeComponent.data.title).toBe('React Component Example');
338
+ expect(codeComponent.data.showLineNumbers).toBe(true);
339
+ expect(codeComponent.data.content).toContain('function MyComponent()');
340
+
341
+ // Verify third child (Sidebar Container)
342
+ const sidebar = parsed.data.children[2];
343
+ expect(sidebar.tagName).toBe('Container');
344
+ expect(sidebar.data.span).toBe(4);
345
+ expect(sidebar.data.background).toBe('grey.100');
346
+ });
347
+ });
348
+
349
+ describe('Data Integrity Verification', () => {
350
+ it('should preserve all ViewSchema properties across serialization', () => {
351
+ const original = (
352
+ <Container
353
+ // Grid props
354
+ span={10}
355
+ xs={12}
356
+ sm={8}
357
+ md={6}
358
+ lg={4}
359
+ xl={3}
360
+
361
+ // Dimension props
362
+ width="large"
363
+ height="medium"
364
+ minWidth="small"
365
+ maxHeight="huge"
366
+
367
+ // Spacing props
368
+ padding="large"
369
+ margin="medium"
370
+ paddingTop="small"
371
+ marginBottom="tiny"
372
+
373
+ // Background props
374
+ background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
375
+ backgroundGradient="radial-gradient(circle, #667eea 0%, #764ba2 100%)"
376
+
377
+ // Style props
378
+ className="comprehensive-test"
379
+ textAlign="center"
380
+ sx={{ borderRadius: 2, boxShadow: 3 }}
381
+ style={{ border: '1px solid #ccc' }}
382
+
383
+ // HTML attributes
384
+ id="test-container"
385
+ role="main"
386
+ aria-label="Comprehensive test container"
387
+ data-testid="round-trip-test"
388
+
389
+ // Event handlers
390
+ onClick={(e) => console.log('clicked')}
391
+ onMouseEnter={(e) => console.log('mouse enter')}
392
+ onFocus={(e) => console.log('focused')}
393
+ >
394
+ Comprehensive test content
395
+ </Container>
396
+ );
397
+
398
+ // Round-trip test
399
+ const firstSerialization = ComponentTransformer.serialize(original);
400
+ const deserialized = ComponentTransformer.deserialize(firstSerialization);
401
+ const secondSerialization = ComponentTransformer.serialize(deserialized);
402
+
403
+ // Verify identical serializations
404
+ expect(firstSerialization).toBe(secondSerialization);
405
+
406
+ // Verify all properties are preserved
407
+ const parsed = JSON.parse(firstSerialization);
408
+ const data = parsed.data;
409
+
410
+ // Grid props
411
+ expect(data.span).toBe(10);
412
+ expect(data.xs).toBe(12);
413
+ expect(data.sm).toBe(8);
414
+ expect(data.md).toBe(6);
415
+ expect(data.lg).toBe(4);
416
+ expect(data.xl).toBe(3);
417
+
418
+ // Dimension props
419
+ expect(data.width).toBe('large');
420
+ expect(data.height).toBe('medium');
421
+ expect(data.minWidth).toBe('small');
422
+ expect(data.maxHeight).toBe('huge');
423
+
424
+ // Spacing props
425
+ expect(data.padding).toBe('large');
426
+ expect(data.margin).toBe('medium');
427
+ expect(data.paddingTop).toBe('small');
428
+ expect(data.marginBottom).toBe('tiny');
429
+
430
+ // Background props
431
+ expect(data.background).toContain('linear-gradient');
432
+ expect(data.backgroundGradient).toContain('radial-gradient');
433
+
434
+ // Style props
435
+ expect(data.className).toBe('comprehensive-test');
436
+ expect(data.textAlign).toBe('center');
437
+ expect(data.sx).toEqual({ borderRadius: 2, boxShadow: 3 });
438
+ expect(data.style).toEqual({ border: '1px solid #ccc' });
439
+
440
+ // HTML attributes
441
+ expect(data.id).toBe('test-container');
442
+ expect(data.role).toBe('main');
443
+ expect(data['aria-label']).toBe('Comprehensive test container');
444
+ expect(data['data-testid']).toBe('round-trip-test');
445
+
446
+ // Event handlers (as strings)
447
+ expect(typeof data.onClick).toBe('string');
448
+ expect(data.onClick).toContain('console.log(\'clicked\')');
449
+ expect(typeof data.onMouseEnter).toBe('string');
450
+ expect(data.onMouseEnter).toContain('console.log(\'mouse enter\')');
451
+ expect(typeof data.onFocus).toBe('string');
452
+ expect(data.onFocus).toContain('console.log(\'focused\')');
453
+
454
+ // Content
455
+ expect(data.children).toBe('Comprehensive test content');
456
+ });
457
+ });
458
+ });
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Image Accessibility Test
3
+ *
4
+ * Tests accessibility features of the Image component to ensure
5
+ * it meets WCAG guidelines and screen reader compatibility.
6
+ */
7
+
8
+ import '@testing-library/jest-dom';
9
+ import { render, screen } from '@testing-library/react';
10
+ import { Image } from '../components/blocks/Image';
11
+
12
+ describe('Image Accessibility', () => {
13
+ beforeEach(() => {
14
+ // Clear any previous accessibility violations
15
+ jest.clearAllMocks();
16
+ });
17
+
18
+ describe('Alt Text Requirements', () => {
19
+ it('should render with proper alt attribute', () => {
20
+ render(
21
+ <Image
22
+ src="https://example.com/test.jpg"
23
+ alt="A beautiful landscape photograph"
24
+ />
25
+ );
26
+
27
+ const img = screen.getByRole('img');
28
+ expect(img).toHaveAttribute('alt', 'A beautiful landscape photograph');
29
+ });
30
+
31
+ it('should handle empty alt text for decorative images', () => {
32
+ render(
33
+ <Image
34
+ src="https://example.com/decorative.jpg"
35
+ alt=""
36
+ />
37
+ );
38
+
39
+ const img = screen.getByRole('img');
40
+ expect(img).toHaveAttribute('alt', '');
41
+ });
42
+
43
+ it('should warn when no alt text provided for content images', () => {
44
+ const consoleSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
45
+
46
+ render(
47
+ <Image
48
+ src="https://example.com/test.jpg"
49
+ />
50
+ );
51
+
52
+ const img = screen.getByRole('img');
53
+ expect(img).toHaveAttribute('alt', '');
54
+
55
+ consoleSpy.mockRestore();
56
+ });
57
+ });
58
+
59
+ describe('Title and Tooltip Support', () => {
60
+ it('should render with title attribute for additional context', () => {
61
+ render(
62
+ <Image
63
+ src="https://example.com/test.jpg"
64
+ alt="Mountain landscape"
65
+ title="Taken at sunset in the Rocky Mountains"
66
+ />
67
+ );
68
+
69
+ const img = screen.getByRole('img');
70
+ expect(img).toHaveAttribute('title', 'Taken at sunset in the Rocky Mountains');
71
+ });
72
+ });
73
+
74
+ describe('Loading States Accessibility', () => {
75
+ it('should provide accessible loading state', () => {
76
+ render(
77
+ <Image
78
+ src="https://example.com/slow-loading.jpg"
79
+ alt="Slow loading image"
80
+ showLoading={true}
81
+ />
82
+ );
83
+
84
+ // The loading skeleton should be present initially
85
+ // This tests that loading states are accessible
86
+ expect(document.querySelector('.image-loading')).toBeInTheDocument();
87
+ });
88
+
89
+ it('should provide accessible error state', () => {
90
+ render(
91
+ <Image
92
+ src="invalid-url"
93
+ alt="Failed image"
94
+ showError={true}
95
+ />
96
+ );
97
+
98
+ // Should render an error state that's accessible
99
+ const errorElement = screen.getByText(/Failed to load image/i);
100
+ expect(errorElement).toBeInTheDocument();
101
+ });
102
+ });
103
+
104
+ describe('Keyboard and Focus', () => {
105
+ it('should not be focusable by default (non-interactive)', () => {
106
+ render(
107
+ <Image
108
+ src="https://example.com/test.jpg"
109
+ alt="Non-interactive image"
110
+ />
111
+ );
112
+
113
+ const img = screen.getByRole('img');
114
+ expect(img).not.toHaveAttribute('tabindex');
115
+ });
116
+
117
+ it('should be focusable when interactive (has onClick)', () => {
118
+ const handleClick = jest.fn();
119
+
120
+ render(
121
+ <Image
122
+ src="https://example.com/test.jpg"
123
+ alt="Clickable image"
124
+ onClick={handleClick}
125
+ />
126
+ );
127
+
128
+ const img = screen.getByRole('img');
129
+ expect(img).toHaveStyle('cursor: pointer');
130
+ });
131
+ });
132
+
133
+ describe('Screen Reader Support', () => {
134
+ it('should have proper role attribute', () => {
135
+ render(
136
+ <Image
137
+ src="https://example.com/test.jpg"
138
+ alt="Test image"
139
+ />
140
+ );
141
+
142
+ const img = screen.getByRole('img');
143
+ expect(img).toBeInTheDocument();
144
+ });
145
+
146
+ it('should provide context through alt and title combination', () => {
147
+ render(
148
+ <Image
149
+ src="https://example.com/chart.jpg"
150
+ alt="Sales performance chart showing 25% increase"
151
+ title="Q4 2024 sales data visualization"
152
+ />
153
+ );
154
+
155
+ const img = screen.getByRole('img');
156
+ expect(img).toHaveAttribute('alt', 'Sales performance chart showing 25% increase');
157
+ expect(img).toHaveAttribute('title', 'Q4 2024 sales data visualization');
158
+ });
159
+ });
160
+
161
+ describe('Serialization Accessibility Preservation', () => {
162
+ it('should preserve accessibility attributes through serialization', () => {
163
+ const originalComponent = (
164
+ <Image
165
+ src="https://example.com/accessible.jpg"
166
+ alt="Accessible image with proper description"
167
+ title="Additional context for screen readers"
168
+ />
169
+ );
170
+
171
+ // This would use ComponentTransformer in a real test
172
+ // For now, we verify the props are correctly structured
173
+ const props = originalComponent.props;
174
+
175
+ expect(props.alt).toBe('Accessible image with proper description');
176
+ expect(props.title).toBe('Additional context for screen readers');
177
+ expect(props.src).toBe('https://example.com/accessible.jpg');
178
+ });
179
+ });
180
+
181
+ describe('Responsive Images Accessibility', () => {
182
+ it('should handle responsive images with proper attributes', () => {
183
+ render(
184
+ <Image
185
+ src="https://example.com/responsive.jpg"
186
+ alt="Responsive image example"
187
+ sizes="(max-width: 768px) 100vw, 50vw"
188
+ srcSet="image-400.jpg 400w, image-800.jpg 800w"
189
+ />
190
+ );
191
+
192
+ const img = screen.getByRole('img');
193
+ expect(img).toHaveAttribute('alt', 'Responsive image example');
194
+ expect(img).toHaveAttribute('sizes', '(max-width: 768px) 100vw, 50vw');
195
+ expect(img).toHaveAttribute('srcset', 'image-400.jpg 400w, image-800.jpg 800w');
196
+ });
197
+ });
198
+
199
+ describe('Drag and Drop Accessibility', () => {
200
+ it('should handle draggable attribute properly', () => {
201
+ render(
202
+ <Image
203
+ src="https://example.com/test.jpg"
204
+ alt="Non-draggable image"
205
+ draggable={false}
206
+ />
207
+ );
208
+
209
+ const img = screen.getByRole('img');
210
+ expect(img).toHaveAttribute('draggable', 'false');
211
+ });
212
+
213
+ it('should allow dragging when explicitly enabled', () => {
214
+ render(
215
+ <Image
216
+ src="https://example.com/test.jpg"
217
+ alt="Draggable image"
218
+ draggable={true}
219
+ />
220
+ );
221
+
222
+ const img = screen.getByRole('img');
223
+ expect(img).toHaveAttribute('draggable', 'true');
224
+ });
225
+ });
226
+ });