@qwickapps/react-framework 1.3.4 → 1.4.0

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 (325) hide show
  1. package/README.md +1688 -2
  2. package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
  3. package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
  4. package/dist/components/ErrorBoundary.d.ts +7 -0
  5. package/dist/components/ErrorBoundary.d.ts.map +1 -1
  6. package/dist/components/Html.d.ts +28 -18
  7. package/dist/components/Html.d.ts.map +1 -1
  8. package/dist/components/Logo.d.ts +12 -35
  9. package/dist/components/Logo.d.ts.map +1 -1
  10. package/dist/components/Markdown.d.ts +18 -13
  11. package/dist/components/Markdown.d.ts.map +1 -1
  12. package/dist/components/QwickApp.d.ts +16 -3
  13. package/dist/components/QwickApp.d.ts.map +1 -1
  14. package/dist/components/QwickIcon.d.ts +23 -0
  15. package/dist/components/QwickIcon.d.ts.map +1 -0
  16. package/dist/components/SafeSpan.d.ts +12 -5
  17. package/dist/components/SafeSpan.d.ts.map +1 -1
  18. package/dist/components/Scaffold.d.ts.map +1 -1
  19. package/dist/components/base/ModelView.d.ts +101 -0
  20. package/dist/components/base/ModelView.d.ts.map +1 -0
  21. package/dist/components/base/index.d.ts +11 -0
  22. package/dist/components/base/index.d.ts.map +1 -0
  23. package/dist/components/blocks/Article.d.ts +12 -2
  24. package/dist/components/blocks/Article.d.ts.map +1 -1
  25. package/dist/components/blocks/Code.d.ts +13 -2
  26. package/dist/components/blocks/Code.d.ts.map +1 -1
  27. package/dist/components/blocks/Content.d.ts.map +1 -1
  28. package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
  29. package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
  30. package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
  31. package/dist/components/blocks/Footer.d.ts.map +1 -1
  32. package/dist/components/blocks/HeroBlock.d.ts +27 -13
  33. package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
  34. package/dist/components/blocks/Image.d.ts +41 -0
  35. package/dist/components/blocks/Image.d.ts.map +1 -0
  36. package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
  37. package/dist/components/blocks/ProductCard.d.ts.map +1 -1
  38. package/dist/components/blocks/Section.d.ts +16 -2
  39. package/dist/components/blocks/Section.d.ts.map +1 -1
  40. package/dist/components/blocks/Text.d.ts +41 -0
  41. package/dist/components/blocks/Text.d.ts.map +1 -0
  42. package/dist/components/blocks/index.d.ts +4 -0
  43. package/dist/components/blocks/index.d.ts.map +1 -1
  44. package/dist/components/buttons/Button.d.ts +23 -7
  45. package/dist/components/buttons/Button.d.ts.map +1 -1
  46. package/dist/components/forms/FormBlock.d.ts +19 -13
  47. package/dist/components/forms/FormBlock.d.ts.map +1 -1
  48. package/dist/components/index.d.ts +4 -0
  49. package/dist/components/index.d.ts.map +1 -1
  50. package/dist/components/input/ChoiceInputField.d.ts +17 -11
  51. package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
  52. package/dist/components/input/HtmlInputField.d.ts +17 -11
  53. package/dist/components/input/HtmlInputField.d.ts.map +1 -1
  54. package/dist/components/input/SelectInputField.d.ts +16 -10
  55. package/dist/components/input/SelectInputField.d.ts.map +1 -1
  56. package/dist/components/input/SwitchInputField.d.ts +16 -10
  57. package/dist/components/input/SwitchInputField.d.ts.map +1 -1
  58. package/dist/components/input/TextField.d.ts.map +1 -1
  59. package/dist/components/input/TextInputField.d.ts +16 -11
  60. package/dist/components/input/TextInputField.d.ts.map +1 -1
  61. package/dist/components/layout/GridCell.d.ts +23 -6
  62. package/dist/components/layout/GridCell.d.ts.map +1 -1
  63. package/dist/components/layout/GridLayout.d.ts +24 -23
  64. package/dist/components/layout/GridLayout.d.ts.map +1 -1
  65. package/dist/components/pages/FormPage.d.ts.map +1 -1
  66. package/dist/components/pages/Page.d.ts +49 -87
  67. package/dist/components/pages/Page.d.ts.map +1 -1
  68. package/dist/components/pages/index.d.ts +2 -2
  69. package/dist/components/pages/index.d.ts.map +1 -1
  70. package/dist/config/AppConfig.d.ts +49 -0
  71. package/dist/config/AppConfig.d.ts.map +1 -0
  72. package/dist/config/AppConfigBuilder.d.ts +75 -0
  73. package/dist/config/AppConfigBuilder.d.ts.map +1 -0
  74. package/dist/config/index.d.ts +13 -0
  75. package/dist/config/index.d.ts.map +1 -0
  76. package/dist/config/types.d.ts +130 -0
  77. package/dist/config/types.d.ts.map +1 -0
  78. package/dist/config.d.ts +15 -0
  79. package/dist/config.d.ts.map +1 -0
  80. package/dist/config.esm.js +451 -0
  81. package/dist/config.js +455 -0
  82. package/dist/contexts/PrintModeContext.d.ts +27 -0
  83. package/dist/contexts/PrintModeContext.d.ts.map +1 -0
  84. package/dist/contexts/QwickAppContext.d.ts +2 -2
  85. package/dist/contexts/QwickAppContext.d.ts.map +1 -1
  86. package/dist/contexts/ThemeContext.d.ts.map +1 -1
  87. package/dist/contexts/index.d.ts +2 -0
  88. package/dist/contexts/index.d.ts.map +1 -1
  89. package/dist/hooks/index.d.ts +2 -0
  90. package/dist/hooks/index.d.ts.map +1 -1
  91. package/dist/hooks/usePrintMode.d.ts +39 -0
  92. package/dist/hooks/usePrintMode.d.ts.map +1 -0
  93. package/dist/index.css +1 -1
  94. package/dist/index.d.ts +1 -0
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.esm.css +1 -1
  97. package/dist/index.esm.js +20722 -16021
  98. package/dist/index.js +20725 -16010
  99. package/dist/schemas/CodeSchema.d.ts +2 -1
  100. package/dist/schemas/CodeSchema.d.ts.map +1 -1
  101. package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
  102. package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
  103. package/dist/schemas/ContentSchema.d.ts +2 -1
  104. package/dist/schemas/ContentSchema.d.ts.map +1 -1
  105. package/dist/schemas/GridCellSchema.d.ts +25 -0
  106. package/dist/schemas/GridCellSchema.d.ts.map +1 -0
  107. package/dist/schemas/GridLayoutSchema.d.ts +23 -0
  108. package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
  109. package/dist/schemas/HtmlSchema.d.ts +14 -0
  110. package/dist/schemas/HtmlSchema.d.ts.map +1 -0
  111. package/dist/schemas/ImageSchema.d.ts +32 -0
  112. package/dist/schemas/ImageSchema.d.ts.map +1 -0
  113. package/dist/schemas/LogoSchema.d.ts +35 -0
  114. package/dist/schemas/LogoSchema.d.ts.map +1 -0
  115. package/dist/schemas/MarkdownSchema.d.ts +14 -0
  116. package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
  117. package/dist/schemas/PageTemplateSchema.d.ts +31 -0
  118. package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
  119. package/dist/schemas/PrintConfigSchema.d.ts +31 -0
  120. package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
  121. package/dist/schemas/SectionSchema.d.ts +2 -1
  122. package/dist/schemas/SectionSchema.d.ts.map +1 -1
  123. package/dist/schemas/TextSchema.d.ts +37 -0
  124. package/dist/schemas/TextSchema.d.ts.map +1 -0
  125. package/dist/schemas/ViewModelSchema.d.ts +23 -0
  126. package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
  127. package/dist/schemas/index.d.ts +15 -1
  128. package/dist/schemas/index.d.ts.map +1 -1
  129. package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
  130. package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
  131. package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
  132. package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
  133. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
  134. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
  135. package/dist/schemas/transformers/registry.d.ts +15 -0
  136. package/dist/schemas/transformers/registry.d.ts.map +1 -0
  137. package/dist/schemas/types/Serializable.d.ts +46 -0
  138. package/dist/schemas/types/Serializable.d.ts.map +1 -0
  139. package/dist/utils/htmlTransform.d.ts.map +1 -1
  140. package/dist/utils/reactUtils.d.ts +12 -3
  141. package/dist/utils/reactUtils.d.ts.map +1 -1
  142. package/package.json +17 -3
  143. package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
  144. package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
  145. package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
  146. package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
  147. package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
  148. package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
  149. package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
  150. package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
  151. package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
  152. package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
  153. package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
  154. package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
  155. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
  156. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
  157. package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
  158. package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
  159. package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
  160. package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
  161. package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
  162. package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
  163. package/src/__tests__/components/Logo.test.js +3 -3
  164. package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
  165. package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
  166. package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
  167. package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
  168. package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
  169. package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
  170. package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
  171. package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
  172. package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
  173. package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
  174. package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
  175. package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
  176. package/src/__tests__/components/base/ModelView.test.tsx +220 -0
  177. package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
  178. package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
  179. package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
  180. package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
  181. package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
  182. package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
  183. package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
  184. package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
  185. package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
  186. package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
  187. package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
  188. package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
  189. package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
  190. package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
  191. package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
  192. package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
  193. package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
  194. package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
  195. package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
  196. package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
  197. package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
  198. package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
  199. package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
  200. package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
  201. package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
  202. package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
  203. package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
  204. package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
  205. package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
  206. package/src/components/ErrorBoundary.tsx +8 -8
  207. package/src/components/Html.tsx +147 -44
  208. package/src/components/Logo.tsx +198 -100
  209. package/src/components/Markdown.tsx +125 -16
  210. package/src/components/QwickApp.tsx +64 -31
  211. package/src/components/QwickIcon.tsx +59 -0
  212. package/src/components/SafeSpan.tsx +65 -10
  213. package/src/components/Scaffold.tsx +2 -8
  214. package/src/components/base/ModelView.tsx +199 -0
  215. package/src/components/base/index.ts +11 -0
  216. package/src/components/blocks/Article.tsx +57 -18
  217. package/src/components/blocks/Code.md +529 -0
  218. package/src/components/blocks/Code.tsx +102 -15
  219. package/src/components/blocks/Content.tsx +25 -77
  220. package/src/components/blocks/CoverImageHeader.tsx +9 -4
  221. package/src/components/blocks/FeatureCard.tsx +1 -2
  222. package/src/components/blocks/FeatureGrid.tsx +19 -1
  223. package/src/components/blocks/Footer.tsx +13 -1
  224. package/src/components/blocks/HeroBlock.tsx +87 -20
  225. package/src/components/blocks/Image.tsx +395 -0
  226. package/src/components/blocks/PageBannerHeader.tsx +14 -12
  227. package/src/components/blocks/ProductCard.tsx +51 -52
  228. package/src/components/blocks/Section.tsx +113 -8
  229. package/src/components/blocks/Text.tsx +285 -0
  230. package/src/components/blocks/index.ts +4 -0
  231. package/src/components/buttons/Button.tsx +184 -15
  232. package/src/components/forms/FormBlock.tsx +70 -17
  233. package/src/components/index.ts +5 -0
  234. package/src/components/input/ChoiceInputField.tsx +48 -18
  235. package/src/components/input/HtmlInputField.tsx +48 -18
  236. package/src/components/input/SelectInputField.tsx +48 -16
  237. package/src/components/input/SwitchInputField.tsx +48 -17
  238. package/src/components/input/TextField.tsx +41 -1
  239. package/src/components/input/TextInputField.tsx +52 -18
  240. package/src/components/layout/GridCell.tsx +118 -9
  241. package/src/components/layout/GridLayout.tsx +125 -24
  242. package/src/components/pages/FormPage.tsx +0 -1
  243. package/src/components/pages/Page.css +304 -332
  244. package/src/components/pages/Page.tsx +307 -255
  245. package/src/components/pages/index.ts +2 -2
  246. package/src/config/AppConfig.ts +133 -0
  247. package/src/config/AppConfigBuilder.ts +421 -0
  248. package/src/config/__tests__/AppConfig.test.ts +385 -0
  249. package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
  250. package/src/config/index.ts +24 -0
  251. package/src/config/types.ts +170 -0
  252. package/src/config.ts +25 -0
  253. package/src/contexts/PrintModeContext.tsx +332 -0
  254. package/src/contexts/QwickAppContext.tsx +2 -2
  255. package/src/contexts/ThemeContext.tsx +1 -2
  256. package/src/contexts/index.ts +2 -0
  257. package/src/hooks/index.ts +5 -1
  258. package/src/hooks/usePrintMode.ts +73 -0
  259. package/src/index.ts +3 -0
  260. package/src/schemas/CodeSchema.ts +3 -3
  261. package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
  262. package/src/schemas/ContentSchema.ts +2 -1
  263. package/src/schemas/GridCellSchema.ts +164 -0
  264. package/src/schemas/GridLayoutSchema.ts +133 -0
  265. package/src/schemas/HtmlSchema.ts +47 -0
  266. package/src/schemas/ImageSchema.ts +235 -0
  267. package/src/schemas/LogoSchema.ts +241 -0
  268. package/src/schemas/MarkdownSchema.ts +47 -0
  269. package/src/schemas/PageTemplateSchema.ts +186 -0
  270. package/src/schemas/PrintConfigSchema.ts +207 -0
  271. package/src/schemas/README.md +661 -0
  272. package/src/schemas/SectionSchema.ts +2 -1
  273. package/src/schemas/TextSchema.ts +329 -0
  274. package/src/schemas/ViewModelSchema.ts +115 -0
  275. package/src/schemas/index.ts +21 -2
  276. package/src/schemas/transformers/ComponentTransformer.ts +403 -0
  277. package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
  278. package/src/schemas/transformers/registry.ts +72 -0
  279. package/src/schemas/types/Serializable.ts +51 -0
  280. package/src/stories/AccessibilityProvider.stories.tsx +253 -253
  281. package/src/stories/Article.stories.tsx +433 -433
  282. package/src/stories/Button.stories.tsx +1 -1
  283. package/src/stories/CardListGrid.stories.tsx +451 -451
  284. package/src/stories/ChoiceInputField.stories.tsx +503 -503
  285. package/src/stories/Code.stories.tsx +1 -1
  286. package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
  287. package/src/stories/Content.stories.tsx +393 -393
  288. package/src/stories/CoverImageHeader.stories.tsx +701 -701
  289. package/src/stories/DataBinding.advanced.stories.tsx +432 -432
  290. package/src/stories/DataProvider.stories.tsx +1192 -1192
  291. package/src/stories/FeatureCard.stories.tsx +557 -557
  292. package/src/stories/FeatureGrid.stories.tsx +594 -594
  293. package/src/stories/Footer.stories.tsx +640 -640
  294. package/src/stories/FormBlock.stories.tsx +760 -760
  295. package/src/stories/FormComponents.stories.tsx +349 -541
  296. package/src/stories/GridCell.stories.tsx +417 -0
  297. package/src/stories/GridLayout.stories.tsx +353 -0
  298. package/src/stories/HeroBlock.stories.tsx +862 -373
  299. package/src/stories/HtmlInputField.stories.tsx +474 -474
  300. package/src/stories/Image.stories.tsx +819 -0
  301. package/src/stories/Introduction.stories.tsx +667 -667
  302. package/src/stories/LayoutBlocks.stories.tsx +324 -324
  303. package/src/stories/Logo.stories.tsx +165 -6
  304. package/src/stories/Markdown.stories.tsx +137 -137
  305. package/src/stories/ModelView.stories.tsx +477 -0
  306. package/src/stories/Page.stories.tsx +688 -688
  307. package/src/stories/PageBannerHeader.stories.tsx +864 -864
  308. package/src/stories/PaletteSwitcher.stories.tsx +119 -119
  309. package/src/stories/ProductCard.stories.tsx +424 -424
  310. package/src/stories/QwickApp.stories.tsx +368 -368
  311. package/src/stories/ResponsiveMenu.stories.tsx +249 -249
  312. package/src/stories/SafeSpan.stories.tsx +531 -531
  313. package/src/stories/Section.stories.tsx +90 -2
  314. package/src/stories/SelectInputField.stories.tsx +524 -524
  315. package/src/stories/Text.stories.tsx +560 -0
  316. package/src/stories/TextInputField.stories.tsx +443 -443
  317. package/src/stories/ThemeSwitcher.stories.tsx +123 -123
  318. package/src/utils/htmlTransform.tsx +74 -53
  319. package/src/utils/reactUtils.tsx +57 -6
  320. package/dist/index.bundled.css +0 -12
  321. /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
  322. /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
  323. /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
  324. /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
  325. /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
@@ -0,0 +1,329 @@
1
+ /**
2
+ * Schema for Text component - Comprehensive typography component
3
+ *
4
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
5
+ */
6
+
7
+ import type { ReactNode } from 'react';
8
+ import { IsBoolean, IsOptional, IsString, IsIn } from 'class-validator';
9
+ import 'reflect-metadata';
10
+ import { Editor, Field, Schema, Model, FieldType, DataType } from '@qwickapps/schema';
11
+
12
+ // Typography variants based on Material-UI Typography variants
13
+ export type TextVariant =
14
+ | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
15
+ | 'subtitle1' | 'subtitle2'
16
+ | 'body1' | 'body2'
17
+ | 'button'
18
+ | 'caption'
19
+ | 'overline';
20
+
21
+ // Text alignment options
22
+ export type TextAlign = 'left' | 'center' | 'right' | 'justify' | 'inherit';
23
+
24
+ // Text color variants
25
+ export type TextColor =
26
+ | 'primary' | 'secondary' | 'textPrimary' | 'textSecondary'
27
+ | 'error' | 'warning' | 'info' | 'success'
28
+ | 'inherit';
29
+
30
+ // HTML element types for semantic markup
31
+ export type TextElement = 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'legend';
32
+
33
+ // Text decoration options
34
+ export type TextDecoration = 'none' | 'underline' | 'overline' | 'line-through';
35
+
36
+ // Font weight options
37
+ export type FontWeight = 'inherit' | 'lighter' | 'normal' | 'bold' | 'bolder' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
38
+
39
+ // Text transform options
40
+ export type TextTransform = 'none' | 'capitalize' | 'uppercase' | 'lowercase' | 'inherit';
41
+
42
+ @Schema('Text', '1.0.0')
43
+ export class TextModel extends Model {
44
+ @Field({ dataType: DataType.STRING })
45
+ @Editor({
46
+ field_type: FieldType.TEXTAREA,
47
+ label: 'Text Content',
48
+ description: 'The text content to display',
49
+ placeholder: 'Enter your text content here...'
50
+ })
51
+ @IsOptional()
52
+ @IsString()
53
+ content?: string;
54
+
55
+ @Field({ defaultValue: 'body1', dataType: DataType.STRING })
56
+ @Editor({
57
+ field_type: FieldType.SELECT,
58
+ label: 'Typography Variant',
59
+ description: 'Typography variant that determines font size, weight, and line height',
60
+ validation: {
61
+ options: [
62
+ { label: 'Heading 1', value: 'h1' },
63
+ { label: 'Heading 2', value: 'h2' },
64
+ { label: 'Heading 3', value: 'h3' },
65
+ { label: 'Heading 4', value: 'h4' },
66
+ { label: 'Heading 5', value: 'h5' },
67
+ { label: 'Heading 6', value: 'h6' },
68
+ { label: 'Subtitle 1', value: 'subtitle1' },
69
+ { label: 'Subtitle 2', value: 'subtitle2' },
70
+ { label: 'Body 1', value: 'body1' },
71
+ { label: 'Body 2', value: 'body2' },
72
+ { label: 'Button', value: 'button' },
73
+ { label: 'Caption', value: 'caption' },
74
+ { label: 'Overline', value: 'overline' }
75
+ ]
76
+ }
77
+ })
78
+ @IsOptional()
79
+ @IsString()
80
+ @IsIn(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'button', 'caption', 'overline'])
81
+ variant?: TextVariant;
82
+
83
+ @Field({ defaultValue: 'inherit', dataType: DataType.STRING })
84
+ @Editor({
85
+ field_type: FieldType.SELECT,
86
+ label: 'Text Color',
87
+ description: 'Color variant for the text',
88
+ validation: {
89
+ options: [
90
+ { label: 'Primary', value: 'primary' },
91
+ { label: 'Secondary', value: 'secondary' },
92
+ { label: 'Text Primary', value: 'textPrimary' },
93
+ { label: 'Text Secondary', value: 'textSecondary' },
94
+ { label: 'Error', value: 'error' },
95
+ { label: 'Warning', value: 'warning' },
96
+ { label: 'Info', value: 'info' },
97
+ { label: 'Success', value: 'success' },
98
+ { label: 'Inherit', value: 'inherit' }
99
+ ]
100
+ }
101
+ })
102
+ @IsOptional()
103
+ @IsString()
104
+ @IsIn(['primary', 'secondary', 'textPrimary', 'textSecondary', 'error', 'warning', 'info', 'success', 'inherit'])
105
+ color?: TextColor;
106
+
107
+ @Field({ defaultValue: 'inherit', dataType: DataType.STRING })
108
+ @Editor({
109
+ field_type: FieldType.SELECT,
110
+ label: 'Text Alignment',
111
+ description: 'How to align the text horizontally',
112
+ validation: {
113
+ options: [
114
+ { label: 'Left', value: 'left' },
115
+ { label: 'Center', value: 'center' },
116
+ { label: 'Right', value: 'right' },
117
+ { label: 'Justify', value: 'justify' },
118
+ { label: 'Inherit', value: 'inherit' }
119
+ ]
120
+ }
121
+ })
122
+ @IsOptional()
123
+ @IsString()
124
+ @IsIn(['left', 'center', 'right', 'justify', 'inherit'])
125
+ align?: TextAlign;
126
+
127
+ @Field({ defaultValue: 'p', dataType: DataType.STRING })
128
+ @Editor({
129
+ field_type: FieldType.SELECT,
130
+ label: 'HTML Element',
131
+ description: 'The HTML element to render (affects semantics and accessibility)',
132
+ validation: {
133
+ options: [
134
+ { label: 'Paragraph (p)', value: 'p' },
135
+ { label: 'Span', value: 'span' },
136
+ { label: 'Div', value: 'div' },
137
+ { label: 'Heading 1 (h1)', value: 'h1' },
138
+ { label: 'Heading 2 (h2)', value: 'h2' },
139
+ { label: 'Heading 3 (h3)', value: 'h3' },
140
+ { label: 'Heading 4 (h4)', value: 'h4' },
141
+ { label: 'Heading 5 (h5)', value: 'h5' },
142
+ { label: 'Heading 6 (h6)', value: 'h6' },
143
+ { label: 'Label', value: 'label' },
144
+ { label: 'Legend', value: 'legend' }
145
+ ]
146
+ }
147
+ })
148
+ @IsOptional()
149
+ @IsString()
150
+ @IsIn(['p', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'label', 'legend'])
151
+ component?: TextElement;
152
+
153
+ @Field({ defaultValue: 'inherit', dataType: DataType.STRING })
154
+ @Editor({
155
+ field_type: FieldType.SELECT,
156
+ label: 'Font Weight',
157
+ description: 'The weight (thickness) of the font',
158
+ validation: {
159
+ options: [
160
+ { label: 'Inherit', value: 'inherit' },
161
+ { label: 'Lighter', value: 'lighter' },
162
+ { label: 'Normal', value: 'normal' },
163
+ { label: 'Bold', value: 'bold' },
164
+ { label: 'Bolder', value: 'bolder' },
165
+ { label: '100', value: '100' },
166
+ { label: '200', value: '200' },
167
+ { label: '300', value: '300' },
168
+ { label: '400', value: '400' },
169
+ { label: '500', value: '500' },
170
+ { label: '600', value: '600' },
171
+ { label: '700', value: '700' },
172
+ { label: '800', value: '800' },
173
+ { label: '900', value: '900' }
174
+ ]
175
+ }
176
+ })
177
+ @IsOptional()
178
+ @IsString()
179
+ @IsIn(['inherit', 'lighter', 'normal', 'bold', 'bolder', '100', '200', '300', '400', '500', '600', '700', '800', '900'])
180
+ fontWeight?: FontWeight;
181
+
182
+ @Field({ defaultValue: 'none', dataType: DataType.STRING })
183
+ @Editor({
184
+ field_type: FieldType.SELECT,
185
+ label: 'Text Decoration',
186
+ description: 'Text decoration style',
187
+ validation: {
188
+ options: [
189
+ { label: 'None', value: 'none' },
190
+ { label: 'Underline', value: 'underline' },
191
+ { label: 'Overline', value: 'overline' },
192
+ { label: 'Line Through', value: 'line-through' }
193
+ ]
194
+ }
195
+ })
196
+ @IsOptional()
197
+ @IsString()
198
+ @IsIn(['none', 'underline', 'overline', 'line-through'])
199
+ textDecoration?: TextDecoration;
200
+
201
+ @Field({ defaultValue: 'none', dataType: DataType.STRING })
202
+ @Editor({
203
+ field_type: FieldType.SELECT,
204
+ label: 'Text Transform',
205
+ description: 'How to transform the text case',
206
+ validation: {
207
+ options: [
208
+ { label: 'None', value: 'none' },
209
+ { label: 'Capitalize', value: 'capitalize' },
210
+ { label: 'Uppercase', value: 'uppercase' },
211
+ { label: 'Lowercase', value: 'lowercase' },
212
+ { label: 'Inherit', value: 'inherit' }
213
+ ]
214
+ }
215
+ })
216
+ @IsOptional()
217
+ @IsString()
218
+ @IsIn(['none', 'capitalize', 'uppercase', 'lowercase', 'inherit'])
219
+ textTransform?: TextTransform;
220
+
221
+ @Field({ defaultValue: false, dataType: DataType.BOOLEAN })
222
+ @Editor({
223
+ field_type: FieldType.BOOLEAN,
224
+ label: 'No Wrap',
225
+ description: 'Prevent text from wrapping to multiple lines'
226
+ })
227
+ @IsOptional()
228
+ @IsBoolean()
229
+ noWrap?: boolean;
230
+
231
+ @Field({ defaultValue: false, dataType: DataType.BOOLEAN })
232
+ @Editor({
233
+ field_type: FieldType.BOOLEAN,
234
+ label: 'Paragraph Mode',
235
+ description: 'Apply paragraph spacing and formatting'
236
+ })
237
+ @IsOptional()
238
+ @IsBoolean()
239
+ paragraph?: boolean;
240
+
241
+ @Field({ defaultValue: false, dataType: DataType.BOOLEAN })
242
+ @Editor({
243
+ field_type: FieldType.BOOLEAN,
244
+ label: 'Gutter Bottom',
245
+ description: 'Add margin bottom for spacing (useful for headings)'
246
+ })
247
+ @IsOptional()
248
+ @IsBoolean()
249
+ gutterBottom?: boolean;
250
+
251
+ @Field({ dataType: DataType.STRING })
252
+ @Editor({
253
+ field_type: FieldType.TEXT,
254
+ label: 'Font Size',
255
+ description: 'Custom font size (overrides variant sizing, e.g., "16px", "1.2rem")',
256
+ placeholder: '16px'
257
+ })
258
+ @IsOptional()
259
+ @IsString()
260
+ fontSize?: string;
261
+
262
+ @Field({ dataType: DataType.STRING })
263
+ @Editor({
264
+ field_type: FieldType.TEXT,
265
+ label: 'Line Height',
266
+ description: 'Custom line height (e.g., "1.5", "24px", "150%")',
267
+ placeholder: '1.5'
268
+ })
269
+ @IsOptional()
270
+ @IsString()
271
+ lineHeight?: string;
272
+
273
+ @Field({ dataType: DataType.STRING })
274
+ @Editor({
275
+ field_type: FieldType.TEXT,
276
+ label: 'Letter Spacing',
277
+ description: 'Custom letter spacing (e.g., "0.1em", "1px")',
278
+ placeholder: '0.1em'
279
+ })
280
+ @IsOptional()
281
+ @IsString()
282
+ letterSpacing?: string;
283
+
284
+ @Field({ dataType: DataType.STRING })
285
+ @Editor({
286
+ field_type: FieldType.TEXT,
287
+ label: 'Font Family',
288
+ description: 'Custom font family (e.g., "Arial, sans-serif")',
289
+ placeholder: 'Arial, sans-serif'
290
+ })
291
+ @IsOptional()
292
+ @IsString()
293
+ fontFamily?: string;
294
+
295
+ @Field({ dataType: DataType.STRING })
296
+ @Editor({
297
+ field_type: FieldType.TEXTAREA,
298
+ label: 'Custom Color',
299
+ description: 'Custom text color (CSS color value, overrides color variant)',
300
+ placeholder: '#333333 or rgb(51, 51, 51)'
301
+ })
302
+ @IsOptional()
303
+ @IsString()
304
+ customColor?: string;
305
+
306
+ @Field({ dataType: DataType.STRING })
307
+ @Editor({
308
+ field_type: FieldType.TEXTAREA,
309
+ label: 'Max Width',
310
+ description: 'Maximum width for the text (e.g., "300px", "50%")',
311
+ placeholder: '300px'
312
+ })
313
+ @IsOptional()
314
+ @IsString()
315
+ maxWidth?: string;
316
+
317
+ // Support for rich content (React node)
318
+ @Field({ dataType: DataType.STRING })
319
+ @Editor({
320
+ field_type: FieldType.TEXTAREA,
321
+ label: 'Rich Content',
322
+ description: 'Rich text content with React elements (for advanced use)',
323
+ placeholder: 'Rich content...'
324
+ })
325
+ @IsOptional()
326
+ children?: ReactNode;
327
+ }
328
+
329
+ export default TextModel;
@@ -0,0 +1,115 @@
1
+ /**
2
+ * ViewModel Schema - Base class for all view components that can be serialized
3
+ *
4
+ * Provides common attributes shared across UI components including
5
+ * styling, accessibility, and layout properties.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+
10
+ import { IsOptional, IsString, IsBoolean } from 'class-validator';
11
+ import 'reflect-metadata';
12
+ import { Editor, Field, FieldType, Model, Schema } from '@qwickapps/schema';
13
+
14
+ @Schema('ViewModel', '1.0.0')
15
+ export class ViewModelSchema extends Model {
16
+ @Field()
17
+ @Editor({
18
+ field_type: FieldType.TEXT,
19
+ label: 'CSS Class Name',
20
+ description: 'Additional CSS class name for custom styling',
21
+ placeholder: 'custom-class-name'
22
+ })
23
+ @IsOptional()
24
+ @IsString()
25
+ className?: string;
26
+
27
+ @Field()
28
+ @Editor({
29
+ field_type: FieldType.TEXT,
30
+ label: 'Inline Styles',
31
+ description: 'Inline CSS styles as JSON string (e.g., {"color": "red", "margin": "10px"})',
32
+ placeholder: '{"property": "value"}'
33
+ })
34
+ @IsOptional()
35
+ @IsString()
36
+ style?: string;
37
+
38
+ @Field()
39
+ @Editor({
40
+ field_type: FieldType.TEXT,
41
+ label: 'Element ID',
42
+ description: 'Unique HTML element ID',
43
+ placeholder: 'unique-element-id'
44
+ })
45
+ @IsOptional()
46
+ @IsString()
47
+ id?: string;
48
+
49
+ @Field({ defaultValue: false })
50
+ @Editor({
51
+ field_type: FieldType.BOOLEAN,
52
+ label: 'Hidden',
53
+ description: 'Whether the component should be hidden from view'
54
+ })
55
+ @IsOptional()
56
+ @IsBoolean()
57
+ hidden?: boolean;
58
+
59
+ @Field()
60
+ @Editor({
61
+ field_type: FieldType.TEXT,
62
+ label: 'ARIA Label',
63
+ description: 'Accessibility label for screen readers',
64
+ placeholder: 'Describe this element...'
65
+ })
66
+ @IsOptional()
67
+ @IsString()
68
+ 'aria-label'?: string;
69
+
70
+ @Field()
71
+ @Editor({
72
+ field_type: FieldType.TEXT,
73
+ label: 'ARIA Described By',
74
+ description: 'IDs of elements that describe this component',
75
+ placeholder: 'element-id-1 element-id-2'
76
+ })
77
+ @IsOptional()
78
+ @IsString()
79
+ 'aria-describedby'?: string;
80
+
81
+ @Field()
82
+ @Editor({
83
+ field_type: FieldType.TEXT,
84
+ label: 'ARIA Labelled By',
85
+ description: 'IDs of elements that label this component',
86
+ placeholder: 'label-element-id'
87
+ })
88
+ @IsOptional()
89
+ @IsString()
90
+ 'aria-labelledby'?: string;
91
+
92
+ @Field()
93
+ @Editor({
94
+ field_type: FieldType.TEXT,
95
+ label: 'Data Test ID',
96
+ description: 'Test automation identifier',
97
+ placeholder: 'test-element-name'
98
+ })
99
+ @IsOptional()
100
+ @IsString()
101
+ 'data-testid'?: string;
102
+
103
+ @Field()
104
+ @Editor({
105
+ field_type: FieldType.TEXT,
106
+ label: 'Role',
107
+ description: 'ARIA role for accessibility',
108
+ placeholder: 'button, navigation, main, etc.'
109
+ })
110
+ @IsOptional()
111
+ @IsString()
112
+ role?: string;
113
+ }
114
+
115
+ export default ViewModelSchema;
@@ -1,12 +1,20 @@
1
1
  /**
2
- * Schemas Module - Declarative Model schema definitions
2
+ * Schemas Module - Declarative Model schema definitions and Component Serialization System
3
3
  *
4
4
  * Exports all Model classes and their type-safe props using the new
5
5
  * declarative pattern with @Schema, @Field, and @Editor decorators.
6
6
  *
7
+ * Also exports the new Component Serialization System for "WebView for React" functionality.
8
+ *
7
9
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
10
  */
9
11
 
12
+ // Component Serialization System
13
+ export type { Serializable, SerializableConstructor } from './types/Serializable';
14
+ export { ComponentTransformer } from './transformers/ComponentTransformer';
15
+ // Auto-register serializable components
16
+ import './transformers/registry';
17
+
10
18
  // Component schema models (declarative pattern)
11
19
  export * from './ActionSchema';
12
20
  export * from './ArticleSchema';
@@ -22,8 +30,13 @@ export * from './FooterItemSchema';
22
30
  export * from './FormBlockSchema';
23
31
  export * from './FooterSchema';
24
32
  export * from './FooterSectionSchema';
33
+ export * from './GridCellSchema';
34
+ export * from './GridLayoutSchema';
25
35
  export * from './HeaderActionSchema';
26
36
  export * from './HeroBlockSchema';
37
+ export * from './HtmlSchema';
38
+ export * from './ImageSchema';
39
+ export * from './MarkdownSchema';
27
40
  export * from './MetadataItemSchema';
28
41
  export * from './PageBannerHeaderSchema';
29
42
  export * from './PaletteSwitcherSchema';
@@ -31,4 +44,10 @@ export * from './ProductCardSchema';
31
44
  export * from './SafeSpanSchema';
32
45
  export * from './SectionSchema';
33
46
  export * from './TextInputFieldSchema';
34
- export * from './ThemeSwitcherSchema';
47
+ export * from './TextSchema';
48
+ export * from './ThemeSwitcherSchema';
49
+
50
+ // Page system schemas
51
+ export * from './ViewModelSchema';
52
+ export * from './PrintConfigSchema';
53
+ export * from './PageTemplateSchema';