@qwickapps/react-framework 1.3.5 → 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 (320) hide show
  1. package/README.md +1681 -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/CoverImageHeader.d.ts.map +1 -1
  28. package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
  29. package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
  30. package/dist/components/blocks/Footer.d.ts.map +1 -1
  31. package/dist/components/blocks/HeroBlock.d.ts +27 -13
  32. package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
  33. package/dist/components/blocks/Image.d.ts +41 -0
  34. package/dist/components/blocks/Image.d.ts.map +1 -0
  35. package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
  36. package/dist/components/blocks/Section.d.ts +16 -2
  37. package/dist/components/blocks/Section.d.ts.map +1 -1
  38. package/dist/components/blocks/Text.d.ts +41 -0
  39. package/dist/components/blocks/Text.d.ts.map +1 -0
  40. package/dist/components/blocks/index.d.ts +4 -0
  41. package/dist/components/blocks/index.d.ts.map +1 -1
  42. package/dist/components/buttons/Button.d.ts +23 -7
  43. package/dist/components/buttons/Button.d.ts.map +1 -1
  44. package/dist/components/forms/FormBlock.d.ts +19 -13
  45. package/dist/components/forms/FormBlock.d.ts.map +1 -1
  46. package/dist/components/index.d.ts +4 -0
  47. package/dist/components/index.d.ts.map +1 -1
  48. package/dist/components/input/ChoiceInputField.d.ts +17 -11
  49. package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
  50. package/dist/components/input/HtmlInputField.d.ts +17 -11
  51. package/dist/components/input/HtmlInputField.d.ts.map +1 -1
  52. package/dist/components/input/SelectInputField.d.ts +16 -10
  53. package/dist/components/input/SelectInputField.d.ts.map +1 -1
  54. package/dist/components/input/SwitchInputField.d.ts +16 -10
  55. package/dist/components/input/SwitchInputField.d.ts.map +1 -1
  56. package/dist/components/input/TextField.d.ts.map +1 -1
  57. package/dist/components/input/TextInputField.d.ts +16 -11
  58. package/dist/components/input/TextInputField.d.ts.map +1 -1
  59. package/dist/components/layout/GridCell.d.ts +23 -6
  60. package/dist/components/layout/GridCell.d.ts.map +1 -1
  61. package/dist/components/layout/GridLayout.d.ts +24 -23
  62. package/dist/components/layout/GridLayout.d.ts.map +1 -1
  63. package/dist/components/pages/FormPage.d.ts.map +1 -1
  64. package/dist/components/pages/Page.d.ts +49 -87
  65. package/dist/components/pages/Page.d.ts.map +1 -1
  66. package/dist/components/pages/index.d.ts +2 -2
  67. package/dist/components/pages/index.d.ts.map +1 -1
  68. package/dist/config/AppConfig.d.ts +49 -0
  69. package/dist/config/AppConfig.d.ts.map +1 -0
  70. package/dist/config/AppConfigBuilder.d.ts +75 -0
  71. package/dist/config/AppConfigBuilder.d.ts.map +1 -0
  72. package/dist/config/index.d.ts +13 -0
  73. package/dist/config/index.d.ts.map +1 -0
  74. package/dist/config/types.d.ts +130 -0
  75. package/dist/config/types.d.ts.map +1 -0
  76. package/dist/config.d.ts +15 -0
  77. package/dist/config.d.ts.map +1 -0
  78. package/dist/config.esm.js +451 -0
  79. package/dist/config.js +455 -0
  80. package/dist/contexts/PrintModeContext.d.ts +27 -0
  81. package/dist/contexts/PrintModeContext.d.ts.map +1 -0
  82. package/dist/contexts/QwickAppContext.d.ts +2 -2
  83. package/dist/contexts/QwickAppContext.d.ts.map +1 -1
  84. package/dist/contexts/index.d.ts +2 -0
  85. package/dist/contexts/index.d.ts.map +1 -1
  86. package/dist/hooks/index.d.ts +2 -0
  87. package/dist/hooks/index.d.ts.map +1 -1
  88. package/dist/hooks/usePrintMode.d.ts +39 -0
  89. package/dist/hooks/usePrintMode.d.ts.map +1 -0
  90. package/dist/index.css +1 -1
  91. package/dist/index.d.ts +1 -0
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.esm.css +1 -1
  94. package/dist/index.esm.js +10951 -6238
  95. package/dist/index.js +11014 -6287
  96. package/dist/schemas/CodeSchema.d.ts +2 -1
  97. package/dist/schemas/CodeSchema.d.ts.map +1 -1
  98. package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
  99. package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
  100. package/dist/schemas/ContentSchema.d.ts +2 -1
  101. package/dist/schemas/ContentSchema.d.ts.map +1 -1
  102. package/dist/schemas/GridCellSchema.d.ts +25 -0
  103. package/dist/schemas/GridCellSchema.d.ts.map +1 -0
  104. package/dist/schemas/GridLayoutSchema.d.ts +23 -0
  105. package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
  106. package/dist/schemas/HtmlSchema.d.ts +14 -0
  107. package/dist/schemas/HtmlSchema.d.ts.map +1 -0
  108. package/dist/schemas/ImageSchema.d.ts +32 -0
  109. package/dist/schemas/ImageSchema.d.ts.map +1 -0
  110. package/dist/schemas/LogoSchema.d.ts +35 -0
  111. package/dist/schemas/LogoSchema.d.ts.map +1 -0
  112. package/dist/schemas/MarkdownSchema.d.ts +14 -0
  113. package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
  114. package/dist/schemas/PageTemplateSchema.d.ts +31 -0
  115. package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
  116. package/dist/schemas/PrintConfigSchema.d.ts +31 -0
  117. package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
  118. package/dist/schemas/SectionSchema.d.ts +2 -1
  119. package/dist/schemas/SectionSchema.d.ts.map +1 -1
  120. package/dist/schemas/TextSchema.d.ts +37 -0
  121. package/dist/schemas/TextSchema.d.ts.map +1 -0
  122. package/dist/schemas/ViewModelSchema.d.ts +23 -0
  123. package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
  124. package/dist/schemas/index.d.ts +15 -1
  125. package/dist/schemas/index.d.ts.map +1 -1
  126. package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
  127. package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
  128. package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
  129. package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
  130. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
  131. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
  132. package/dist/schemas/transformers/registry.d.ts +15 -0
  133. package/dist/schemas/transformers/registry.d.ts.map +1 -0
  134. package/dist/schemas/types/Serializable.d.ts +46 -0
  135. package/dist/schemas/types/Serializable.d.ts.map +1 -0
  136. package/dist/utils/htmlTransform.d.ts.map +1 -1
  137. package/dist/utils/reactUtils.d.ts +12 -3
  138. package/dist/utils/reactUtils.d.ts.map +1 -1
  139. package/package.json +17 -3
  140. package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
  141. package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
  142. package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
  143. package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
  144. package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
  145. package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
  146. package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
  147. package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
  148. package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
  149. package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
  150. package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
  151. package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
  152. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
  153. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
  154. package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
  155. package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
  156. package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
  157. package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
  158. package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
  159. package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
  160. package/src/__tests__/components/Logo.test.js +3 -3
  161. package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
  162. package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
  163. package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
  164. package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
  165. package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
  166. package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
  167. package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
  168. package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
  169. package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
  170. package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
  171. package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
  172. package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
  173. package/src/__tests__/components/base/ModelView.test.tsx +220 -0
  174. package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
  175. package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
  176. package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
  177. package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
  178. package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
  179. package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
  180. package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
  181. package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
  182. package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
  183. package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
  184. package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
  185. package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
  186. package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
  187. package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
  188. package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
  189. package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
  190. package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
  191. package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
  192. package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
  193. package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
  194. package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
  195. package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
  196. package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
  197. package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
  198. package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
  199. package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
  200. package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
  201. package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
  202. package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
  203. package/src/components/ErrorBoundary.tsx +8 -8
  204. package/src/components/Html.tsx +147 -44
  205. package/src/components/Logo.tsx +198 -100
  206. package/src/components/Markdown.tsx +125 -16
  207. package/src/components/QwickApp.tsx +64 -31
  208. package/src/components/QwickIcon.tsx +59 -0
  209. package/src/components/SafeSpan.tsx +65 -10
  210. package/src/components/Scaffold.tsx +2 -8
  211. package/src/components/base/ModelView.tsx +199 -0
  212. package/src/components/base/index.ts +11 -0
  213. package/src/components/blocks/Article.tsx +57 -18
  214. package/src/components/blocks/Code.md +529 -0
  215. package/src/components/blocks/Code.tsx +102 -15
  216. package/src/components/blocks/CoverImageHeader.tsx +9 -4
  217. package/src/components/blocks/FeatureCard.tsx +1 -2
  218. package/src/components/blocks/FeatureGrid.tsx +19 -1
  219. package/src/components/blocks/Footer.tsx +13 -1
  220. package/src/components/blocks/HeroBlock.tsx +87 -20
  221. package/src/components/blocks/Image.tsx +395 -0
  222. package/src/components/blocks/PageBannerHeader.tsx +14 -12
  223. package/src/components/blocks/ProductCard.tsx +1 -1
  224. package/src/components/blocks/Section.tsx +113 -8
  225. package/src/components/blocks/Text.tsx +285 -0
  226. package/src/components/blocks/index.ts +4 -0
  227. package/src/components/buttons/Button.tsx +184 -15
  228. package/src/components/forms/FormBlock.tsx +70 -17
  229. package/src/components/index.ts +5 -0
  230. package/src/components/input/ChoiceInputField.tsx +48 -18
  231. package/src/components/input/HtmlInputField.tsx +48 -18
  232. package/src/components/input/SelectInputField.tsx +48 -16
  233. package/src/components/input/SwitchInputField.tsx +48 -17
  234. package/src/components/input/TextField.tsx +41 -1
  235. package/src/components/input/TextInputField.tsx +52 -18
  236. package/src/components/layout/GridCell.tsx +118 -9
  237. package/src/components/layout/GridLayout.tsx +125 -24
  238. package/src/components/pages/FormPage.tsx +0 -1
  239. package/src/components/pages/Page.css +304 -332
  240. package/src/components/pages/Page.tsx +307 -255
  241. package/src/components/pages/index.ts +2 -2
  242. package/src/config/AppConfig.ts +133 -0
  243. package/src/config/AppConfigBuilder.ts +421 -0
  244. package/src/config/__tests__/AppConfig.test.ts +385 -0
  245. package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
  246. package/src/config/index.ts +24 -0
  247. package/src/config/types.ts +170 -0
  248. package/src/config.ts +25 -0
  249. package/src/contexts/PrintModeContext.tsx +332 -0
  250. package/src/contexts/QwickAppContext.tsx +2 -2
  251. package/src/contexts/index.ts +2 -0
  252. package/src/hooks/index.ts +5 -1
  253. package/src/hooks/usePrintMode.ts +73 -0
  254. package/src/index.ts +3 -0
  255. package/src/schemas/CodeSchema.ts +3 -3
  256. package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
  257. package/src/schemas/ContentSchema.ts +2 -1
  258. package/src/schemas/GridCellSchema.ts +164 -0
  259. package/src/schemas/GridLayoutSchema.ts +133 -0
  260. package/src/schemas/HtmlSchema.ts +47 -0
  261. package/src/schemas/ImageSchema.ts +235 -0
  262. package/src/schemas/LogoSchema.ts +241 -0
  263. package/src/schemas/MarkdownSchema.ts +47 -0
  264. package/src/schemas/PageTemplateSchema.ts +186 -0
  265. package/src/schemas/PrintConfigSchema.ts +207 -0
  266. package/src/schemas/README.md +661 -0
  267. package/src/schemas/SectionSchema.ts +2 -1
  268. package/src/schemas/TextSchema.ts +329 -0
  269. package/src/schemas/ViewModelSchema.ts +115 -0
  270. package/src/schemas/index.ts +21 -2
  271. package/src/schemas/transformers/ComponentTransformer.ts +403 -0
  272. package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
  273. package/src/schemas/transformers/registry.ts +72 -0
  274. package/src/schemas/types/Serializable.ts +51 -0
  275. package/src/stories/AccessibilityProvider.stories.tsx +253 -253
  276. package/src/stories/Article.stories.tsx +433 -433
  277. package/src/stories/Button.stories.tsx +1 -1
  278. package/src/stories/CardListGrid.stories.tsx +451 -451
  279. package/src/stories/ChoiceInputField.stories.tsx +503 -503
  280. package/src/stories/Code.stories.tsx +1 -1
  281. package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
  282. package/src/stories/Content.stories.tsx +393 -393
  283. package/src/stories/CoverImageHeader.stories.tsx +701 -701
  284. package/src/stories/DataBinding.advanced.stories.tsx +432 -432
  285. package/src/stories/DataProvider.stories.tsx +1192 -1192
  286. package/src/stories/FeatureCard.stories.tsx +557 -557
  287. package/src/stories/FeatureGrid.stories.tsx +594 -594
  288. package/src/stories/Footer.stories.tsx +640 -640
  289. package/src/stories/FormBlock.stories.tsx +760 -760
  290. package/src/stories/FormComponents.stories.tsx +349 -541
  291. package/src/stories/GridCell.stories.tsx +417 -0
  292. package/src/stories/GridLayout.stories.tsx +353 -0
  293. package/src/stories/HeroBlock.stories.tsx +862 -373
  294. package/src/stories/HtmlInputField.stories.tsx +474 -474
  295. package/src/stories/Image.stories.tsx +819 -0
  296. package/src/stories/Introduction.stories.tsx +667 -667
  297. package/src/stories/LayoutBlocks.stories.tsx +324 -324
  298. package/src/stories/Logo.stories.tsx +165 -6
  299. package/src/stories/Markdown.stories.tsx +137 -137
  300. package/src/stories/ModelView.stories.tsx +477 -0
  301. package/src/stories/Page.stories.tsx +688 -688
  302. package/src/stories/PageBannerHeader.stories.tsx +864 -864
  303. package/src/stories/PaletteSwitcher.stories.tsx +119 -119
  304. package/src/stories/ProductCard.stories.tsx +424 -424
  305. package/src/stories/QwickApp.stories.tsx +368 -368
  306. package/src/stories/ResponsiveMenu.stories.tsx +249 -249
  307. package/src/stories/SafeSpan.stories.tsx +531 -531
  308. package/src/stories/Section.stories.tsx +90 -2
  309. package/src/stories/SelectInputField.stories.tsx +524 -524
  310. package/src/stories/Text.stories.tsx +560 -0
  311. package/src/stories/TextInputField.stories.tsx +443 -443
  312. package/src/stories/ThemeSwitcher.stories.tsx +123 -123
  313. package/src/utils/htmlTransform.tsx +74 -53
  314. package/src/utils/reactUtils.tsx +57 -6
  315. package/dist/index.bundled.css +0 -12
  316. /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
  317. /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
  318. /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
  319. /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
  320. /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * MockSerializableComponent - Test helper component implementing new SerializableConstructor interface
3
+ *
4
+ * NOTE: This is not a test file - it's a helper module for testing.
5
+ * Jest should not run this as a test suite.
6
+ *
7
+ * Demonstrates component self-declaration pattern with static tagName and version properties
8
+ * Used for testing the updated ComponentTransformer architecture
9
+ *
10
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
11
+ */
12
+ import React, { ReactElement } from 'react';
13
+ import { Serializable, SerializableConstructor } from '../../../schemas';
14
+ /**
15
+ * Mock component implementing the new Serializable interface with self-declaration
16
+ */
17
+ export declare class MockSerializableComponent implements Serializable {
18
+ props: {
19
+ title?: string;
20
+ content?: string;
21
+ variant?: string;
22
+ children?: React.ReactNode;
23
+ };
24
+ static readonly tagName = "MockComponent";
25
+ static readonly version = "1.0.0";
26
+ constructor(props: {
27
+ title?: string;
28
+ content?: string;
29
+ variant?: string;
30
+ children?: React.ReactNode;
31
+ });
32
+ static fromJson(jsonData: any): ReactElement;
33
+ toJson(): any;
34
+ }
35
+ export declare const MockSerializableComponentClass: SerializableConstructor;
36
+ /**
37
+ * Alternative mock component with different tagName and version for testing conflicts
38
+ */
39
+ export declare class AlternativeMockComponent implements Serializable {
40
+ props: {
41
+ label?: string;
42
+ type?: string;
43
+ active?: boolean;
44
+ };
45
+ static readonly tagName = "AlternativeComponent";
46
+ static readonly version = "2.1.0";
47
+ constructor(props: {
48
+ label?: string;
49
+ type?: string;
50
+ active?: boolean;
51
+ });
52
+ static fromJson(jsonData: any): ReactElement;
53
+ toJson(): any;
54
+ }
55
+ export declare const AlternativeMockComponentClass: SerializableConstructor;
56
+ /**
57
+ * Mock component missing required static properties (for error testing)
58
+ */
59
+ export declare class InvalidMockComponent implements Serializable {
60
+ props: any;
61
+ constructor(props: any);
62
+ static fromJson(jsonData: any): ReactElement;
63
+ toJson(): any;
64
+ }
65
+ export declare const InvalidMockComponentClass: any;
66
+ //# sourceMappingURL=MockSerializableComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockSerializableComponent.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/schemas/transformers/MockSerializableComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEzE;;GAEG;AACH,qBAAa,yBAA0B,YAAW,YAAY;IAIzC,KAAK,EAAE;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,C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AA2B,GAAG,CAAC"}
@@ -1,4 +1,11 @@
1
1
  import React, { Component, ErrorInfo, ReactNode } from 'react';
2
+ declare global {
3
+ interface Window {
4
+ qwickapps?: {
5
+ logError?: (error: Error, errorInfo: ErrorInfo) => void;
6
+ };
7
+ }
8
+ }
2
9
  interface Props {
3
10
  children: ReactNode;
4
11
  fallback?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/D,UAAU,KAAK;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,UAAU,KAAK;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC7C,KAAK,EAAE,KAAK;IASxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IASpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAwBpD,WAAW,aAMT;IAEF,aAAa,aAIX;IAEF,MAAM;CAgHN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EACjD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,kBAAkB,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU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AED,CAAC;;EAS5C;AAED,eAAe,aAAa,CAAC"}
@@ -21,28 +21,38 @@
21
21
  *
22
22
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
23
23
  */
24
- import React from 'react';
25
- import { WithBaseProps } from '../hooks';
26
- import { TransformConfig } from '../utils/htmlTransform';
27
- export interface HtmlProps extends WithBaseProps {
28
- /** HTML content as string */
29
- children: string;
30
- /** Custom transformation configuration */
24
+ import React, { ReactElement } from 'react';
25
+ import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
26
+ import HtmlModel from '../schemas/HtmlSchema';
27
+ import { ModelView } from './base/ModelView';
28
+ export interface TransformConfig {
29
+ rules?: any[];
30
+ sanitize?: boolean;
31
+ sanitizeOptions?: any;
32
+ fallbackComponent?: (element: Element, key: string) => React.ReactNode;
33
+ }
34
+ type HtmlViewProps = ModelProps<HtmlModel> & {
35
+ /** Custom transformation configuration (legacy - now handled by ComponentTransformer) */
31
36
  transformConfig?: TransformConfig;
32
- /** Whether to strip header elements (useful for articles) */
33
- stripHeaders?: boolean;
34
- /** Whether to sanitize HTML (default: true) */
37
+ /** Whether to sanitize HTML (legacy - now handled internally) */
35
38
  sanitize?: boolean;
36
- /** Custom sanitization options */
39
+ /** Custom sanitization options (legacy - now handled internally) */
37
40
  sanitizeOptions?: any;
38
- /** Fallback content when HTML is empty */
39
- placeholder?: string;
40
- /** Container element type */
41
+ /** Container element type (React.ElementType for internal use, string in model for serialization) */
41
42
  component?: React.ElementType;
43
+ };
44
+ export interface HtmlProps extends HtmlViewProps, WithDataBinding {
45
+ }
46
+ export declare class Html extends ModelView<HtmlProps, HtmlModel> {
47
+ static readonly tagName = "Html";
48
+ static readonly version = "1.0.0";
49
+ static fromJson(jsonData: any): ReactElement;
50
+ protected getComponentSpecificProps(): any;
51
+ protected renderView(): React.ReactElement;
52
+ protected renderWithDataBinding(): React.ReactElement;
53
+ static registerPatternHandlers(registry: any): void;
54
+ private static transformHtmlDiv;
55
+ private static transformDataHtml;
42
56
  }
43
- /**
44
- * Html component - transforms HTML strings to React components
45
- */
46
- export declare function Html({ children, transformConfig, stripHeaders, sanitize, sanitizeOptions, placeholder, component, ...restProps }: HtmlProps): import("react/jsx-runtime").JSX.Element | null;
47
57
  export default Html;
48
58
  //# sourceMappingURL=Html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Html.d.ts","sourceRoot":"","sources":["../../src/components/Html.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoC,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3E,OAAO,EACL,eAAe,EAIhB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAa,EACb,eAAe,EACf,YAAoB,EACpB,QAAe,EACf,eAAe,EACf,WAAW,EACX,SAAiB,EACjB,GAAG,SAAS,EACb,EAAE,SAAS,kDA4HX;AAED,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Html.d.ts","sourceRoot":"","sources":["../../src/components/Html.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO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BAAiB;CAcjC;AAsCD,eAAe,IAAI,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dynamic Logo Component - Generic theme-aware logo
2
+ * Dynamic Logo Component - Generic theme-aware logo with image support
3
3
  *
4
4
  * Features:
5
5
  * - Automatic text width calculation with dynamic SVG sizing
@@ -10,6 +10,7 @@
10
10
  * - Accessibility support with proper ARIA labels
11
11
  * - Customizable styling via CSS classes for each text part
12
12
  * - Text formatting with escape sequences
13
+ * - Image support with flexible positioning
13
14
  *
14
15
  * Text Formatting (TWO PARTS MAXIMUM):
15
16
  * - Use \n for line breaks (second part appears on new line)
@@ -34,46 +35,22 @@
34
35
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
35
36
  */
36
37
  import React from 'react';
37
- import { WithBaseProps } from '../hooks/useBaseProps';
38
+ import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
39
+ import LogoModel from '../schemas/LogoSchema';
40
+ import { LogoVariant, LogoSize, LogoBadgeShape, PositionType, BadgeOffset } from '../schemas/LogoSchema';
38
41
  import './Logo.css';
39
- export type LogoVariant = 'default' | 'high-contrast' | 'monochrome' | 'on-primary';
40
- export type LogoSize = 'tiny' | 'small' | 'medium' | 'large' | 'extra-large';
41
- export type LogoBadgeShape = 'circle' | 'star' | 'square' | 'heart';
42
- export type BadgePositionType = 'none' | 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
43
- export interface BadgeOffset {
44
- /** Horizontal offset from the calculated position (positive = right, negative = left) */
45
- x?: number;
46
- /** Vertical offset from the calculated position (positive = down, negative = up) */
47
- y?: number;
48
- }
49
- export interface LogoProps extends WithBaseProps, Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height' | 'className' | 'style' | 'role' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onFocus' | 'onBlur'> {
50
- /** Logo name/text to display. Supports up to TWO parts with \n for line breaks and \s for explicit spaces. */
51
- name?: string;
42
+ type LogoViewProps = ModelProps<LogoModel> & {
52
43
  /** Click handler for the logo */
53
- onClick?: (event: React.MouseEvent<SVGSVGElement>) => void;
44
+ onClick?: (event: React.MouseEvent<SVGSVGElement | HTMLDivElement>) => void;
54
45
  /** Additional inline styles */
55
46
  style?: React.CSSProperties;
56
- /** Visual variant of the logo */
57
- variant?: LogoVariant;
58
- /** Size variant of the logo (controls both text size and visual height) */
59
- size?: LogoSize;
60
47
  /** Additional CSS class names */
61
48
  className?: string;
62
- /** Badge position and visibility. 'none' hides the badge, others show it at the specified position. */
63
- badge?: BadgePositionType;
64
- /** Shape of the badge */
65
- badgeShape?: LogoBadgeShape;
66
- /** Offset from the calculated badge position. Applied after position calculation. Automatically scales with logo size. */
67
- badgeOffset?: BadgeOffset;
68
- /** Font family for the logo text */
69
- fontFamily?: string;
70
- /** Font weight for the logo text */
71
- fontWeight?: string | number;
72
- /** CSS class name for the first part of the logo text. Defaults to 'logo-first-part'. */
73
- firstPartClass?: string;
74
- /** CSS class name for the second part of the logo text. Defaults to 'logo-second-part'. */
75
- secondPartClass?: string;
49
+ };
50
+ interface LogoProps extends LogoViewProps, WithDataBinding {
76
51
  }
77
- declare const Logo: React.FC<LogoProps>;
52
+ declare function Logo(props: LogoProps): import("react/jsx-runtime").JSX.Element;
53
+ export type { LogoVariant, LogoSize, LogoBadgeShape, PositionType, BadgeOffset };
54
+ export type { LogoProps, LogoViewProps };
78
55
  export default Logo;
79
56
  //# sourceMappingURL=Logo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,aAAa,EAAoC,MAAM,uBAAuB,CAAC;AACxF,OAAO,YAAY,CAAC;AAEpB,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,GAA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,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAEzC,eAAe,IAAI,CAAC"}
@@ -20,28 +20,33 @@
20
20
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
21
21
  */
22
22
  import { marked } from 'marked';
23
- import React from 'react';
24
- import { WithBaseProps } from '../hooks';
23
+ import React, { ReactElement } from 'react';
24
+ import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
25
+ import MarkdownModel from '../schemas/MarkdownSchema';
26
+ import { ModelView } from './base/ModelView';
25
27
  import { TransformConfig } from '../utils/htmlTransform';
26
- export interface MarkdownProps extends WithBaseProps {
27
- /** Markdown content as string */
28
- children: string;
28
+ type MarkdownViewProps = ModelProps<MarkdownModel> & {
29
29
  /** Custom transformation configuration for HTML conversion */
30
30
  htmlTransformConfig?: TransformConfig;
31
- /** Whether to sanitize HTML output (default: true) */
32
- sanitize?: boolean;
33
31
  /** Custom sanitization options */
34
32
  sanitizeOptions?: any;
35
- /** Fallback content when Markdown is empty */
36
- placeholder?: string;
37
33
  /** Container element type */
38
34
  component?: React.ElementType;
39
35
  /** Marked options for Markdown parsing */
40
36
  markedOptions?: marked.MarkedOptions;
37
+ };
38
+ export interface MarkdownProps extends MarkdownViewProps, WithDataBinding {
39
+ }
40
+ export declare class Markdown extends ModelView<MarkdownProps, MarkdownModel> {
41
+ static readonly tagName = "Markdown";
42
+ static readonly version = "1.0.0";
43
+ static fromJson(jsonData: any): ReactElement;
44
+ protected getComponentSpecificProps(): any;
45
+ protected renderView(): React.ReactElement;
46
+ protected renderWithDataBinding(): React.ReactElement;
47
+ static registerPatternHandlers(registry: any): void;
48
+ private static transformMarkdownDiv;
49
+ private static transformDataMarkdown;
41
50
  }
42
- /**
43
- * Markdown component - converts Markdown to React components via Html
44
- */
45
- export declare function Markdown({ children, htmlTransformConfig, sanitize, sanitizeOptions, placeholder, component, markedOptions, ...restProps }: MarkdownProps): import("react/jsx-runtime").JSX.Element | null;
46
51
  export default Markdown;
47
52
  //# sourceMappingURL=Markdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoC,aAAa,EAAE,MAAM,UAAU,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAE/E,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC9B,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC;CACtC;AAsBD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAa,EACb,mBAAmB,EACnB,QAAe,EACf,eAAe,EACf,WAAW,EACX,SAAiB,EACjB,aAAa,EACb,GAAG,SAAS,EACb,EAAE,aAAa,kDA6Gf;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAE/E,KAAK,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,GAAG;IACnD,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,kCAAkC;IAClC,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC9B,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,eAAe;CAAG;AAgJ5E,qBAAa,QAAS,SAAQ,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEnE,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAc;IACrC,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAGlC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY;IAK5C,SAAS,CAAC,yBAAyB,IAAI,GAAG;IAS1C,SAAS,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY;IAM1C,SAAS,CAAC,qBAAqB,IAAI,KAAK,CAAC,YAAY;IAKrD,MAAM,CAAC,uBAAuB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;IAanD,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAenC,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAcrC;AAsCD,eAAe,QAAQ,CAAC"}
@@ -4,12 +4,17 @@
4
4
  * This component eliminates the need to manually set up provider hierarchy.
5
5
  * Provides theme system, app context, optional scaffolding, and routing.
6
6
  *
7
- * Example usage:
7
+ * Example usage with config:
8
8
  * ```tsx
9
9
  * import { BrowserRouter } from 'react-router-dom';
10
- * import { QwickApp, AuthProvider, JsonDataProvider } from '@qwickapps/react-framework';
10
+ * import { QwickApp, AuthProvider, JsonDataProvider, AppConfigBuilder } from '@qwickapps/react-framework';
11
11
  *
12
12
  * function App() {
13
+ * const config = AppConfigBuilder.create()
14
+ * .withName("My App")
15
+ * .withId("my.app")
16
+ * .build();
17
+ *
13
18
  * const dataSource = {
14
19
  * dataProvider: new JsonDataProvider({ data: { company: [...] } }),
15
20
  * cacheProvider: true, // Use default MemoryCacheProvider
@@ -17,7 +22,7 @@
17
22
  * };
18
23
  *
19
24
  * return (
20
- * <QwickApp appName="My App" appId="my.app" dataSource={dataSource}>
25
+ * <QwickApp config={config} dataSource={dataSource}>
21
26
  * <AuthProvider router={<BrowserRouter />} user={user}>
22
27
  * <Route path="/" component={HomePage} />
23
28
  * <Route path="/admin" component={AdminPage} requiresRole="admin" />
@@ -33,6 +38,7 @@ import React from 'react';
33
38
  import { type ThemeMode } from '../contexts';
34
39
  import { type QwickAppContextValue, type QwickAppProps } from '../contexts/QwickAppContext';
35
40
  import { type TemplateResolverConfig } from '../types';
41
+ import { AppConfig } from '../config';
36
42
  import './QwickApp.css';
37
43
  interface QwickAppComponentProps extends QwickAppProps {
38
44
  /** Child components to render when no routing is used */
@@ -49,6 +55,13 @@ interface QwickAppComponentProps extends QwickAppProps {
49
55
  router?: React.ReactElement;
50
56
  /** Data source configuration for content management and template resolution */
51
57
  dataSource?: TemplateResolverConfig;
58
+ /**
59
+ * AppConfig instance - when provided, overrides individual props
60
+ * @example
61
+ * const config = AppConfigBuilder.create().withName("My App").build();
62
+ * <QwickApp config={config}>...</QwickApp>
63
+ */
64
+ config?: AppConfig;
52
65
  }
53
66
  export declare const QwickApp: React.FC<QwickAppComponentProps>;
54
67
  export declare const useQwickApp: () => QwickAppContextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"QwickApp.d.ts","sourceRoot":"","sources":["../../src/components/QwickApp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AAU,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,gBAAgB,CAAC;AAQxB,UAAU,sBAAuB,SAAQ,aAAa;IACpD,yDAAyD;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,8CAA8C;IAC9C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CAEpB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA+GrD,CAAC;AAEF,eAAO,MAAM,WAAW,QAAO,oBAM9B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * QwickIcon - Official QwickApps brand icon
3
+ *
4
+ * A reusable SVG icon component for the QwickApps brand that can be used
5
+ * across all QwickApps applications. Features customizable size and
6
+ * optional background for different use cases.
7
+ *
8
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
9
+ */
10
+ import React from 'react';
11
+ export interface QwickIconProps {
12
+ /** Size of the icon in pixels */
13
+ size?: number;
14
+ /** Whether to show the background rectangle */
15
+ showBackground?: boolean;
16
+ /** Additional CSS class names */
17
+ className?: string;
18
+ /** Additional inline styles */
19
+ style?: React.CSSProperties;
20
+ }
21
+ declare const QwickIcon: React.FC<QwickIconProps>;
22
+ export default QwickIcon;
23
+ //# sourceMappingURL=QwickIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QwickIcon.d.ts","sourceRoot":"","sources":["../../src/components/QwickIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiCvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -9,15 +9,22 @@
9
9
  *
10
10
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
11
11
  */
12
+ import React, { ReactElement } from 'react';
12
13
  import { WithDataBinding, ModelProps } from '@qwickapps/schema';
13
14
  import SafeSpanModel from '../schemas/SafeSpanSchema';
15
+ import { ModelView } from './base/ModelView';
14
16
  type SafeSpanViewProps = ModelProps<SafeSpanModel>;
15
17
  export interface SafeSpanProps extends SafeSpanViewProps, WithDataBinding {
16
18
  }
17
- /**
18
- * SafeSpan component with data binding support
19
- * Supports both traditional props and dataSource-driven rendering
20
- */
21
- declare function SafeSpan(props: SafeSpanProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare class SafeSpan extends ModelView<SafeSpanProps, SafeSpanModel> {
20
+ static readonly tagName = "SafeSpan";
21
+ static readonly version = "1.0.0";
22
+ static fromJson(jsonData: any): ReactElement;
23
+ protected getComponentSpecificProps(): any;
24
+ protected renderView(): React.ReactElement;
25
+ protected renderWithDataBinding(): React.ReactElement;
26
+ static registerPatternHandlers(registry: any): void;
27
+ private static transformSafeSpan;
28
+ }
22
29
  export default SafeSpan;
23
30
  //# sourceMappingURL=SafeSpan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SafeSpan.d.ts","sourceRoot":"","sources":["../../src/components/SafeSpan.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,KAAK,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AACnD,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,eAAe;CAAG;AAyE5E;;;GAGG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,kDA8BrC;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"SafeSpan.d.ts","sourceRoot":"","sources":["../../src/components/SafeSpan.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,KAAK,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AACnD,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,eAAe;CAAG;AA6E5E,qBAAa,QAAS,SAAQ,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEnE,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAc;IACrC,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAGlC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY;IAK5C,SAAS,CAAC,yBAAyB,IAAI,GAAG;IAQ1C,SAAS,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY;IAM1C,SAAS,CAAC,qBAAqB,IAAI,KAAK,CAAC,YAAY;IAKrD,MAAM,CAAC,uBAA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MAAM,IAAI,CAAC;CAC1B;AAWD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0XrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * ModelView - Abstract Base Class for Serializable Components
3
+ *
4
+ * Provides common serialization patterns and data binding support for
5
+ * all QwickApps components. This eliminates code duplication and ensures
6
+ * consistent behavior across all serializable components.
7
+ *
8
+ * All components extending ModelView must implement:
9
+ * - getComponentSpecificProps(): Component-specific serialization properties
10
+ * - renderView(): Render method for traditional props
11
+ * - renderWithDataBinding(): Render method for data-bound components
12
+ * - static tagName and version properties
13
+ *
14
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
15
+ */
16
+ import React, { ReactElement, ReactNode } from 'react';
17
+ import type { WithDataBinding } from '@qwickapps/schema';
18
+ import { Serializable } from '../../schemas/types/Serializable';
19
+ /**
20
+ * Abstract base class for all serializable QwickApps components
21
+ * Handles common serialization patterns, data binding, and rendering logic
22
+ */
23
+ export declare abstract class ModelView<TProps = any, TModel = any> extends React.Component<TProps & WithDataBinding> implements Serializable {
24
+ static readonly tagName: string;
25
+ static readonly version: string;
26
+ /**
27
+ * Common fromJson implementation
28
+ * Subclasses can override this if they need custom deserialization logic
29
+ */
30
+ static fromJson(jsonData: any): ReactElement;
31
+ /**
32
+ * Common toJson implementation with hooks for customization
33
+ * Combines base serializable props with component-specific props
34
+ */
35
+ toJson(): any;
36
+ /**
37
+ * Common base props that all components serialize
38
+ * Handles ReactNode children, data binding, and common styling props
39
+ */
40
+ protected getBaseSerializableProps(): any;
41
+ /**
42
+ * Hook for subclasses to add component-specific serialization
43
+ * Must be implemented by each component to include its specific props
44
+ */
45
+ protected abstract getComponentSpecificProps(): any;
46
+ /**
47
+ * Common children serialization logic
48
+ * Handles different children types based on component capabilities
49
+ */
50
+ protected serializeChildren(children: ReactNode): any;
51
+ /**
52
+ * Helper to determine if children contain other serializable components
53
+ * Override in subclasses that support nested components (like Section)
54
+ */
55
+ protected hasNestedComponents(children: ReactNode): boolean;
56
+ /**
57
+ * Common render pattern
58
+ * Determines whether to use data binding or traditional props rendering
59
+ */
60
+ render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
61
+ /**
62
+ * Hook for subclasses to implement traditional props rendering
63
+ * This is where the component renders using props directly
64
+ */
65
+ protected abstract renderView(): React.ReactElement;
66
+ /**
67
+ * Hook for subclasses to implement data binding rendering
68
+ * This should render the data-bound version of the component
69
+ */
70
+ protected abstract renderWithDataBinding(): React.ReactElement;
71
+ /**
72
+ * Register HTML pattern handlers for this component
73
+ * Override this method to register patterns that this component can handle
74
+ * @param registry - ComponentTransformer to register patterns with
75
+ */
76
+ static registerPatternHandlers(registry: any): void;
77
+ }
78
+ /**
79
+ * Type helper for ModelView component constructors
80
+ * Ensures proper typing for registration and factory functions
81
+ */
82
+ export interface ModelViewConstructor<TProps = any, TModel = any> {
83
+ new (props: TProps & WithDataBinding): ModelView<TProps, TModel>;
84
+ readonly tagName: string;
85
+ readonly version: string;
86
+ fromJson(jsonData: any): ReactElement;
87
+ }
88
+ /**
89
+ * Helper function to create a ModelView component class
90
+ * Provides better TypeScript inference for component registration
91
+ */
92
+ export declare function createModelViewClass<TProps, TModel>(config: {
93
+ tagName: string;
94
+ version: string;
95
+ getComponentSpecificProps: (props: TProps) => any;
96
+ hasNestedComponents?: (children: ReactNode) => boolean;
97
+ renderView: (props: TProps) => React.ReactElement;
98
+ renderWithDataBinding: (props: TProps & WithDataBinding) => React.ReactElement;
99
+ }): ModelViewConstructor<TProps, TModel>;
100
+ export default ModelView;
101
+ //# sourceMappingURL=ModelView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelView.d.ts","sourceRoot":"","sources":["../../../src/components/base/ModelView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;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,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EACjD,MAAM,EAAE;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;IAClD,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC;IACvD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,CAAC;IAClD,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,KAAK,KAAK,CAAC,YAAY,CAAC;CAChF,GACA,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBtC;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Base Components and Abstractions
3
+ *
4
+ * Provides common base classes and utilities for creating
5
+ * serializable QwickApps components.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ export { default as ModelView, createModelViewClass } from './ModelView';
10
+ export type { ModelViewConstructor } from './ModelView';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
@@ -13,11 +13,21 @@
13
13
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
14
14
  */
15
15
  import { WithDataBinding, ModelProps } from '@qwickapps/schema';
16
+ import React, { ReactElement } from 'react';
16
17
  import ArticleModel from '../../schemas/ArticleSchema';
18
+ import { ModelView } from '../base/ModelView';
17
19
  type ArticleViewProps = ModelProps<ArticleModel>;
18
20
  export interface ArticleProps extends ArticleViewProps, WithDataBinding {
19
21
  }
20
- declare function Article(props: ArticleProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export declare class Article extends ModelView<ArticleProps, ArticleModel> {
23
+ static readonly tagName = "Article";
24
+ static readonly version = "1.0.0";
25
+ static fromJson(jsonData: any): ReactElement;
26
+ protected getComponentSpecificProps(): any;
27
+ protected renderView(): React.ReactElement;
28
+ protected renderWithDataBinding(): React.ReactElement;
29
+ static registerPatternHandlers(registry: any): void;
30
+ private static transformArticle;
31
+ }
21
32
  export default Article;
22
- export { Article };
23
33
  //# sourceMappingURL=Article.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Article.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/Article.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAIvD,KAAK,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,eAAe;CACtE;AAuGD,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,kDA6DnC;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"Article.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/Article.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,KAAK,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,eAAe;CACtE;AAgGD,qBAAa,OAAQ,SAAQ,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAEhE,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IACpC,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAGlC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY;IAK5C,SAAS,CAAC,yBAAyB,IAAI,GAAG;IAQ1C,SAAS,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY;IAM1C,SAAS,CAAC,qBAAqB,IAAI,KAAK,CAAC,YAAY;IAKrD,MAAM,CAAC,uBAAuB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;IAQnD,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAWhC;AA6DD,eAAe,OAAO,CAAC"}
@@ -11,11 +11,22 @@
11
11
  * Copyright (c) 2025 QwickApps.com. All rights reserved.
12
12
  */
13
13
  import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
14
+ import React, { ReactElement } from 'react';
14
15
  import CodeModel from '../../schemas/CodeSchema';
16
+ import { ModelView } from '../base/ModelView';
15
17
  type CodeViewProps = ModelProps<CodeModel>;
16
18
  export interface CodeProps extends CodeViewProps, WithDataBinding {
17
19
  }
18
- declare function Code(props: CodeProps): import("react/jsx-runtime").JSX.Element | null;
20
+ export declare class Code extends ModelView<CodeProps, CodeModel> {
21
+ static readonly tagName = "Code";
22
+ static readonly version = "1.0.0";
23
+ static fromJson(jsonData: any): ReactElement;
24
+ protected getComponentSpecificProps(): any;
25
+ protected renderView(): React.ReactElement;
26
+ protected renderWithDataBinding(): React.ReactElement;
27
+ static registerPatternHandlers(registry: any): void;
28
+ private static transformPreCode;
29
+ private static transformCodeHighlight;
30
+ }
19
31
  export default Code;
20
- export { Code };
21
32
  //# sourceMappingURL=Code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/Code.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,KAAK,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAE3C,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,eAAe;CAAG;AAuNpE,iBAAS,IAAI,CAAC,KAAK,EAAE,SAAS,kDA4D7B;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/Code.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,KAAK,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAE3C,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,eAAe;CAAG;AA0NpE,qBAAa,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAEvD,MAAM,CAAC,QAAQ,CAAC,OAAO,UAAU;IACjC,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAGlC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY;IAK5C,SAAS,CAAC,yBAAyB,IAAI,GAAG;IAY1C,SAAS,CAAC,UAA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