@qwickapps/react-framework 1.4.1 → 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.
- package/QUICK_START_GUIDE.md +82 -0
- package/README.md +221 -21
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +1 -2
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +1 -2
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +32 -0
- package/dist/components/base/Container.d.ts.map +1 -0
- package/dist/components/base/ContainerView.d.ts +65 -0
- package/dist/components/base/ContainerView.d.ts.map +1 -0
- package/dist/components/base/ModelView.d.ts +37 -46
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +3 -2
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +1 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code-factory.d.ts +22 -0
- package/dist/components/blocks/Code-factory.d.ts.map +1 -0
- package/dist/components/blocks/Code-old.d.ts +31 -0
- package/dist/components/blocks/Code-old.d.ts.map +1 -0
- package/dist/components/blocks/Code.d.ts +30 -18
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +1 -2
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +1 -2
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +1 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +35 -27
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +1 -2
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +1 -2
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +1 -2
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +1 -2
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +29 -47
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -3
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +68 -0
- package/dist/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/components/shared/viewProps.d.ts +37 -0
- package/dist/components/shared/viewProps.d.ts.map +1 -0
- package/dist/index.esm.js +21782 -22580
- package/dist/index.js +21782 -22579
- package/dist/qa/ConsoleWarningTest.d.ts +5 -0
- package/dist/qa/ConsoleWarningTest.d.ts.map +1 -0
- package/dist/qa/StorageKeyTest.d.ts +6 -0
- package/dist/qa/StorageKeyTest.d.ts.map +1 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts +6 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +1 -0
- package/dist/schemas/CodeSchema.d.ts +2 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/ContainerSchema.d.ts +12 -0
- package/dist/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +3 -3
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -1
- package/dist/schemas/ViewModelSchema.d.ts +46 -6
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +65 -0
- package/dist/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +27 -15
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +3 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/src/components/AccessibilityChecker.d.ts +12 -0
- package/dist/src/components/AccessibilityChecker.d.ts.map +1 -0
- package/dist/src/components/AccessibilityProvider.d.ts +64 -0
- package/dist/src/components/AccessibilityProvider.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs.d.ts +39 -0
- package/dist/src/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/ErrorBoundary.d.ts +46 -0
- package/dist/src/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/components/Html.d.ts +58 -0
- package/dist/src/components/Html.d.ts.map +1 -0
- package/dist/src/components/Logo.d.ts +56 -0
- package/dist/src/components/Logo.d.ts.map +1 -0
- package/dist/src/components/Markdown.d.ts +51 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/QwickApp.d.ts +69 -0
- package/dist/src/components/QwickApp.d.ts.map +1 -0
- package/dist/src/components/QwickAppsLogo.d.ts +25 -0
- package/dist/src/components/QwickAppsLogo.d.ts.map +1 -0
- package/dist/src/components/QwickIcon.d.ts +23 -0
- package/dist/src/components/QwickIcon.d.ts.map +1 -0
- package/dist/src/components/ResponsiveMenu.d.ts +38 -0
- package/dist/src/components/ResponsiveMenu.d.ts.map +1 -0
- package/dist/src/components/SafeSpan.d.ts +29 -0
- package/dist/src/components/SafeSpan.d.ts.map +1 -0
- package/dist/src/components/Scaffold.d.ts +57 -0
- package/dist/src/components/Scaffold.d.ts.map +1 -0
- package/dist/src/components/base/Container.d.ts +33 -0
- package/dist/src/components/base/Container.d.ts.map +1 -0
- package/dist/src/components/base/ModelView.d.ts +92 -0
- package/dist/src/components/base/ModelView.d.ts.map +1 -0
- package/dist/src/components/base/index.d.ts +12 -0
- package/dist/src/components/base/index.d.ts.map +1 -0
- package/dist/src/components/blocks/Article.d.ts +32 -0
- package/dist/src/components/blocks/Article.d.ts.map +1 -0
- package/dist/src/components/blocks/CardListGrid.d.ts +23 -0
- package/dist/src/components/blocks/CardListGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Code.d.ts +37 -0
- package/dist/src/components/blocks/Code.d.ts.map +1 -0
- package/dist/src/components/blocks/Content.d.ts +24 -0
- package/dist/src/components/blocks/Content.d.ts.map +1 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts +44 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureCard.d.ts +66 -0
- package/dist/src/components/blocks/FeatureCard.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts +48 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Footer.d.ts +56 -0
- package/dist/src/components/blocks/Footer.d.ts.map +1 -0
- package/dist/src/components/blocks/HeroBlock.d.ts +55 -0
- package/dist/src/components/blocks/HeroBlock.d.ts.map +1 -0
- package/dist/src/components/blocks/Image.d.ts +40 -0
- package/dist/src/components/blocks/Image.d.ts.map +1 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts +30 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/ProductCard.d.ts +57 -0
- package/dist/src/components/blocks/ProductCard.d.ts.map +1 -0
- package/dist/src/components/blocks/Section.d.ts +45 -0
- package/dist/src/components/blocks/Section.d.ts.map +1 -0
- package/dist/src/components/blocks/Text.d.ts +34 -0
- package/dist/src/components/blocks/Text.d.ts.map +1 -0
- package/dist/src/components/blocks/index.d.ts +41 -0
- package/dist/src/components/blocks/index.d.ts.map +1 -0
- package/dist/src/components/buttons/Button.d.ts +41 -0
- package/dist/src/components/buttons/Button.d.ts.map +1 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/index.d.ts +11 -0
- package/dist/src/components/buttons/index.d.ts.map +1 -0
- package/dist/src/components/forms/FormBlock.d.ts +51 -0
- package/dist/src/components/forms/FormBlock.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +8 -0
- package/dist/src/components/forms/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +41 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/input/ChoiceInputField.d.ts +29 -0
- package/dist/src/components/input/ChoiceInputField.d.ts.map +1 -0
- package/dist/src/components/input/HtmlInputField.d.ts +33 -0
- package/dist/src/components/input/HtmlInputField.d.ts.map +1 -0
- package/dist/src/components/input/SelectInputField.d.ts +31 -0
- package/dist/src/components/input/SelectInputField.d.ts.map +1 -0
- package/dist/src/components/input/SwitchInputField.d.ts +27 -0
- package/dist/src/components/input/SwitchInputField.d.ts.map +1 -0
- package/dist/src/components/input/TextField.d.ts +18 -0
- package/dist/src/components/input/TextField.d.ts.map +1 -0
- package/dist/src/components/input/TextInputField.d.ts +34 -0
- package/dist/src/components/input/TextInputField.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +19 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +9 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
- package/dist/src/components/layout/GridCell.d.ts +32 -0
- package/dist/src/components/layout/GridCell.d.ts.map +1 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts +46 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +1 -0
- package/dist/src/components/layout/GridLayout.d.ts +50 -0
- package/dist/src/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/src/components/layout/index.d.ts +14 -0
- package/dist/src/components/layout/index.d.ts.map +1 -0
- package/dist/src/components/menu/Menu.d.ts +1 -0
- package/dist/src/components/menu/Menu.d.ts.map +1 -0
- package/dist/src/components/menu/MenuItem.d.ts +31 -0
- package/dist/src/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/src/components/menu/index.d.ts +7 -0
- package/dist/src/components/menu/index.d.ts.map +1 -0
- package/dist/src/components/pages/FormPage.d.ts +66 -0
- package/dist/src/components/pages/FormPage.d.ts.map +1 -0
- package/dist/src/components/pages/Page.d.ts +68 -0
- package/dist/src/components/pages/Page.d.ts.map +1 -0
- package/dist/src/components/pages/index.d.ts +10 -0
- package/dist/src/components/pages/index.d.ts.map +1 -0
- package/dist/src/components/shared/createSerializableView.d.ts +81 -0
- package/dist/src/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/src/components/shared/viewProps.d.ts +37 -0
- package/dist/src/components/shared/viewProps.d.ts.map +1 -0
- package/dist/src/config/AppConfig.d.ts +49 -0
- package/dist/src/config/AppConfig.d.ts.map +1 -0
- package/dist/src/config/AppConfigBuilder.d.ts +75 -0
- package/dist/src/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +13 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types.d.ts +130 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config.d.ts +15 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/contexts/DataContext.d.ts +139 -0
- package/dist/src/contexts/DataContext.d.ts.map +1 -0
- package/dist/src/contexts/DimensionsContext.d.ts +42 -0
- package/dist/src/contexts/DimensionsContext.d.ts.map +1 -0
- package/dist/src/contexts/PaletteContext.d.ts +53 -0
- package/dist/src/contexts/PaletteContext.d.ts.map +1 -0
- package/dist/src/contexts/PrintModeContext.d.ts +27 -0
- package/dist/src/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/src/contexts/QwickAppContext.d.ts +71 -0
- package/dist/src/contexts/QwickAppContext.d.ts.map +1 -0
- package/dist/src/contexts/ThemeContext.d.ts +65 -0
- package/dist/src/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/src/contexts/index.d.ts +11 -0
- package/dist/src/contexts/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +12 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useBaseProps.d.ts +101 -0
- package/dist/src/hooks/useBaseProps.d.ts.map +1 -0
- package/dist/src/hooks/useDataBinding.d.ts +22 -0
- package/dist/src/hooks/useDataBinding.d.ts.map +1 -0
- package/dist/src/hooks/usePrintMode.d.ts +39 -0
- package/dist/src/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/palettes/PaletteAutumn.d.ts +10 -0
- package/dist/src/palettes/PaletteAutumn.d.ts.map +1 -0
- package/dist/src/palettes/PaletteCosmic.d.ts +10 -0
- package/dist/src/palettes/PaletteCosmic.d.ts.map +1 -0
- package/dist/src/palettes/PaletteDefault.d.ts +10 -0
- package/dist/src/palettes/PaletteDefault.d.ts.map +1 -0
- package/dist/src/palettes/PaletteOcean.d.ts +10 -0
- package/dist/src/palettes/PaletteOcean.d.ts.map +1 -0
- package/dist/src/palettes/PaletteSpring.d.ts +10 -0
- package/dist/src/palettes/PaletteSpring.d.ts.map +1 -0
- package/dist/src/palettes/PaletteWinter.d.ts +10 -0
- package/dist/src/palettes/PaletteWinter.d.ts.map +1 -0
- package/dist/src/palettes/index.d.ts +13 -0
- package/dist/src/palettes/index.d.ts.map +1 -0
- package/dist/src/schemas/ActionSchema.d.ts +21 -0
- package/dist/src/schemas/ActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/ArticleSchema.d.ts +13 -0
- package/dist/src/schemas/ArticleSchema.d.ts.map +1 -0
- package/dist/src/schemas/ButtonSchema.d.ts +19 -0
- package/dist/src/schemas/ButtonSchema.d.ts.map +1 -0
- package/dist/src/schemas/CardListGridSchema.d.ts +17 -0
- package/dist/src/schemas/CardListGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/CodeSchema.d.ts +18 -0
- package/dist/src/schemas/CodeSchema.d.ts.map +1 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +32 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContainerSchema.d.ts +12 -0
- package/dist/src/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContentSchema.d.ts +21 -0
- package/dist/src/schemas/ContentSchema.d.ts.map +1 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts +28 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts +17 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts +16 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterItemSchema.d.ts +15 -0
- package/dist/src/schemas/FooterItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSchema.d.ts +20 -0
- package/dist/src/schemas/FooterSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts +15 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/FormBlockSchema.d.ts +19 -0
- package/dist/src/schemas/FormBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridCellSchema.d.ts +23 -0
- package/dist/src/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts +21 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts +17 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts +22 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlSchema.d.ts +14 -0
- package/dist/src/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/src/schemas/ImageSchema.d.ts +32 -0
- package/dist/src/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/src/schemas/LogoSchema.d.ts +35 -0
- package/dist/src/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/src/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/src/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts +13 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +16 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/src/schemas/ProductCardSchema.d.ts +39 -0
- package/dist/src/schemas/ProductCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts +13 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +1 -0
- package/dist/src/schemas/SectionSchema.d.ts +16 -0
- package/dist/src/schemas/SectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +27 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts +22 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextSchema.d.ts +37 -0
- package/dist/src/schemas/TextSchema.d.ts.map +1 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +19 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/ViewSchema.d.ts +66 -0
- package/dist/src/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/src/schemas/index.d.ts +47 -0
- package/dist/src/schemas/index.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +128 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/registry.d.ts +18 -0
- package/dist/src/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/src/schemas/types/Serializable.d.ts +46 -0
- package/dist/src/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts +44 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/src/templates/TemplateResolver.d.ts +52 -0
- package/dist/src/templates/TemplateResolver.d.ts.map +1 -0
- package/dist/src/templates/index.d.ts +7 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/types/CacheProvider.d.ts +18 -0
- package/dist/src/types/CacheProvider.d.ts.map +1 -0
- package/dist/src/types/CollapsibleLayout.d.ts +142 -0
- package/dist/src/types/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/types/ContentProxy.d.ts +47 -0
- package/dist/src/types/ContentProxy.d.ts.map +1 -0
- package/dist/src/types/DataTypes.d.ts +185 -0
- package/dist/src/types/DataTypes.d.ts.map +1 -0
- package/dist/src/types/TemplateProvider.d.ts +10 -0
- package/dist/src/types/TemplateProvider.d.ts.map +1 -0
- package/dist/src/types/TemplateResolver.d.ts +23 -0
- package/dist/src/types/TemplateResolver.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +82 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/utils/breakpoints.d.ts +35 -0
- package/dist/src/utils/breakpoints.d.ts.map +1 -0
- package/dist/src/utils/cssUtils.d.ts +17 -0
- package/dist/src/utils/cssUtils.d.ts.map +1 -0
- package/dist/src/utils/customPaletteManager.d.ts +8 -0
- package/dist/src/utils/customPaletteManager.d.ts.map +1 -0
- package/dist/src/utils/dimensions.d.ts +34 -0
- package/dist/src/utils/dimensions.d.ts.map +1 -0
- package/dist/src/utils/htmlTransform.d.ts +44 -0
- package/dist/src/utils/htmlTransform.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +16 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +26 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/paletteUtils.d.ts +38 -0
- package/dist/src/utils/paletteUtils.d.ts.map +1 -0
- package/dist/src/utils/persistenceUtils.d.ts +31 -0
- package/dist/src/utils/persistenceUtils.d.ts.map +1 -0
- package/dist/src/utils/reactUtils.d.ts +33 -0
- package/dist/src/utils/reactUtils.d.ts.map +1 -0
- package/dist/src/utils/spacing.d.ts +34 -0
- package/dist/src/utils/spacing.d.ts.map +1 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts +32 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +1 -0
- package/dist/src/utils/themeUtils.d.ts +27 -0
- package/dist/src/utils/themeUtils.d.ts.map +1 -0
- package/dist/utils/cssUtils.d.ts +17 -0
- package/dist/utils/cssUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/scripts/bundle-css.cjs +27 -0
- package/scripts/create-project.sh +28 -0
- package/scripts/create-qwickapps-project.js +284 -0
- package/src/__tests__/components/base/Container.test.tsx +966 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +1 -1
- package/src/__tests__/schemas/ViewSchema.test.ts +805 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +19 -19
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +13 -13
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +39 -39
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +14 -14
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +8 -8
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +181 -0
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +458 -0
- package/src/__tests__/test_image_accessibility.test.tsx +226 -0
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/Html.tsx +24 -15
- package/src/components/Logo.tsx +2 -2
- package/src/components/Markdown.tsx +2 -7
- package/src/components/SafeSpan.tsx +2 -7
- package/src/components/base/Container.tsx +61 -0
- package/src/components/base/ModelView.tsx +225 -91
- package/src/components/base/index.ts +3 -2
- package/src/components/blocks/Article.tsx +2 -7
- package/src/components/blocks/CardListGrid.tsx +2 -2
- package/src/components/blocks/Code.tsx +91 -179
- package/src/components/blocks/Content.tsx +2 -2
- package/src/components/blocks/CoverImageHeader.tsx +2 -2
- package/src/components/blocks/HeroBlock.tsx +54 -146
- package/src/components/blocks/Image.tsx +82 -196
- package/src/components/blocks/PageBannerHeader.tsx +2 -2
- package/src/components/blocks/Section.tsx +79 -181
- package/src/components/blocks/Text.tsx +100 -198
- package/src/components/buttons/Button.tsx +85 -183
- package/src/components/buttons/PaletteSwitcher.tsx +2 -2
- package/src/components/buttons/ThemeSwitcher.tsx +2 -2
- package/src/components/forms/FormBlock.tsx +2 -2
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +76 -160
- package/src/components/input/HtmlInputField.tsx +141 -264
- package/src/components/input/SelectInputField.tsx +48 -153
- package/src/components/input/SwitchInputField.tsx +41 -139
- package/src/components/input/TextInputField.tsx +39 -116
- package/src/components/layout/GridCell.tsx +36 -122
- package/src/components/layout/GridLayout.tsx +55 -127
- package/src/components/pages/Page.tsx +268 -276
- package/src/components/pages/index.ts +2 -3
- package/src/components/shared/createSerializableView.tsx +280 -0
- package/src/components/shared/viewProps.ts +207 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +2 -2
- package/src/contexts/DataContext.tsx +1 -1
- package/src/schemas/ButtonSchema.ts +3 -2
- package/src/schemas/CardListGridSchema.ts +3 -2
- package/src/schemas/ChoiceInputFieldSchema.ts +3 -2
- package/src/schemas/CodeSchema.ts +8 -6
- package/src/schemas/ContainerSchema.ts +25 -0
- package/src/schemas/FeatureCardSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +3 -2
- package/src/schemas/GridCellSchema.ts +4 -10
- package/src/schemas/GridLayoutSchema.ts +8 -14
- package/src/schemas/HeroBlockSchema.ts +3 -2
- package/src/schemas/HtmlInputFieldSchema.ts +3 -2
- package/src/schemas/ImageSchema.ts +3 -2
- package/src/schemas/PageTemplateSchema.ts +5 -5
- package/src/schemas/SectionSchema.ts +4 -12
- package/src/schemas/SelectInputFieldSchema.ts +3 -2
- package/src/schemas/SwitchInputFieldSchema.ts +2 -2
- package/src/schemas/TextInputFieldSchema.ts +3 -2
- package/src/schemas/ViewSchema.ts +570 -0
- package/src/schemas/index.ts +1 -1
- package/src/schemas/transformers/ComponentTransformer.ts +185 -163
- package/src/schemas/transformers/ReactNodeTransformer.ts +31 -28
- package/src/schemas/transformers/registry.ts +17 -10
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ChoiceInputField.stories.tsx +28 -1
- package/src/stories/Code.stories.tsx +61 -1
- package/src/stories/Container.stories.tsx +954 -0
- package/src/stories/FormBlock.stories.tsx +54 -0
- package/src/stories/FormComponents.stories.tsx +8 -13
- package/src/stories/GridCell.stories.tsx +23 -64
- package/src/stories/GridLayout.stories.tsx +22 -47
- package/src/stories/HeroBlock.stories.tsx +28 -0
- package/src/stories/HtmlInputField.stories.tsx +23 -1
- package/src/stories/Image.stories.tsx +45 -233
- package/src/stories/Markdown.stories.tsx +1 -1
- package/src/stories/Section.stories.tsx +38 -4
- package/src/stories/SelectInputField.stories.tsx +26 -1
- package/src/stories/Text.stories.tsx +22 -54
- package/src/stories/TextInputField.stories.tsx +24 -1
- package/src/stories/_templates/SerializationTemplate.tsx +165 -0
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/utils/cssUtils.ts +49 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.ts +13 -13
- package/src/__tests__/components/base/ModelView.test.tsx +0 -220
- package/src/__tests__/schemas/ViewModelSchema.test.ts +0 -80
- package/src/components/blocks/Code.md +0 -529
- package/src/schemas/README.md +0 -661
- package/src/schemas/ViewModelSchema.ts +0 -115
- package/src/tests/ConsoleWarningTest.tsx +0 -30
- package/src/tests/StorageKeyTest.tsx +0 -110
- package/src/tests/ThemeStorageKeyTest.tsx +0 -114
|
@@ -114,7 +114,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
114
114
|
describe('Serialization Speed Benchmarks', () => {
|
|
115
115
|
it('should serialize 1000 simple components within performance budget', () => {
|
|
116
116
|
const components = Array.from({ length: 1000 }, (_, i) => ({
|
|
117
|
-
|
|
117
|
+
tagName: 'Button',
|
|
118
118
|
version: '1.0.0',
|
|
119
119
|
data: {
|
|
120
120
|
id: `btn-${i}`,
|
|
@@ -137,12 +137,12 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
137
137
|
it('should deserialize complex nested structures efficiently', () => {
|
|
138
138
|
// Create nested structure with 10 sections, each containing 50 buttons
|
|
139
139
|
const nestedStructure = Array.from({ length: 10 }, (_, sectionIndex) => ({
|
|
140
|
-
|
|
140
|
+
tagName: 'Section',
|
|
141
141
|
version: '1.0.0',
|
|
142
142
|
data: {
|
|
143
143
|
id: `section-${sectionIndex}`,
|
|
144
144
|
children: Array.from({ length: 50 }, (_, buttonIndex) => ({
|
|
145
|
-
|
|
145
|
+
tagName: 'Button',
|
|
146
146
|
version: '1.0.0',
|
|
147
147
|
data: {
|
|
148
148
|
id: `btn-${sectionIndex}-${buttonIndex}`,
|
|
@@ -167,12 +167,12 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
167
167
|
|
|
168
168
|
it('should handle roundtrip serialization efficiently', () => {
|
|
169
169
|
const testData = Array.from({ length: 100 }, (_, i) => ({
|
|
170
|
-
|
|
170
|
+
tagName: 'Section',
|
|
171
171
|
version: '1.0.0',
|
|
172
172
|
data: {
|
|
173
173
|
id: `section-${i}`,
|
|
174
174
|
children: [{
|
|
175
|
-
|
|
175
|
+
tagName: 'Button',
|
|
176
176
|
version: '1.0.0',
|
|
177
177
|
data: { id: `btn-${i}`, label: `Button ${i}` }
|
|
178
178
|
}]
|
|
@@ -200,7 +200,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
200
200
|
describe('Memory Usage Validation', () => {
|
|
201
201
|
it('should not create excessive memory overhead for large component trees', () => {
|
|
202
202
|
const largeComponentTree = Array.from({ length: 5000 }, (_, i) => ({
|
|
203
|
-
|
|
203
|
+
tagName: 'Button',
|
|
204
204
|
version: '1.0.0',
|
|
205
205
|
data: {
|
|
206
206
|
id: `large-btn-${i}`,
|
|
@@ -235,7 +235,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
235
235
|
// Create and process large data
|
|
236
236
|
for (let batch = 0; batch < 10; batch++) {
|
|
237
237
|
const batchData = Array.from({ length: 1000 }, (_, i) => ({
|
|
238
|
-
|
|
238
|
+
tagName: 'Button',
|
|
239
239
|
version: '1.0.0',
|
|
240
240
|
data: { id: `batch-${batch}-btn-${i}`, label: `Button ${i}` }
|
|
241
241
|
}));
|
|
@@ -266,7 +266,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
266
266
|
|
|
267
267
|
for (const count of componentCounts) {
|
|
268
268
|
const components = Array.from({ length: count }, (_, i) => ({
|
|
269
|
-
|
|
269
|
+
tagName: 'Button',
|
|
270
270
|
version: '1.0.0',
|
|
271
271
|
data: { id: `scale-btn-${i}`, label: `Button ${i}` }
|
|
272
272
|
}));
|
|
@@ -304,14 +304,14 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
304
304
|
for (const depth of depths) {
|
|
305
305
|
// Create nested structure
|
|
306
306
|
let nestedData: any = {
|
|
307
|
-
|
|
307
|
+
tagName: 'Button',
|
|
308
308
|
version: '1.0.0',
|
|
309
309
|
data: { id: 'deep-button', label: `Button at depth ${depth}` }
|
|
310
310
|
};
|
|
311
311
|
|
|
312
312
|
for (let level = 0; level < depth; level++) {
|
|
313
313
|
nestedData = {
|
|
314
|
-
|
|
314
|
+
tagName: 'Section',
|
|
315
315
|
version: '1.0.0',
|
|
316
316
|
data: {
|
|
317
317
|
id: `section-level-${level}`,
|
|
@@ -351,7 +351,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
351
351
|
// Test with 10,000 components
|
|
352
352
|
const extremeCount = 10000;
|
|
353
353
|
const components = Array.from({ length: extremeCount }, (_, i) => ({
|
|
354
|
-
|
|
354
|
+
tagName: 'Button',
|
|
355
355
|
version: '1.0.0',
|
|
356
356
|
data: {
|
|
357
357
|
id: `extreme-btn-${i}`,
|
|
@@ -382,7 +382,7 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
382
382
|
|
|
383
383
|
const operations = Array.from({ length: concurrentOperations }, (_, opIndex) => {
|
|
384
384
|
const components = Array.from({ length: componentsPerOperation }, (_, compIndex) => ({
|
|
385
|
-
|
|
385
|
+
tagName: 'Button',
|
|
386
386
|
version: '1.0.0',
|
|
387
387
|
data: {
|
|
388
388
|
id: `concurrent-op${opIndex}-btn${compIndex}`,
|
|
@@ -420,13 +420,13 @@ describe('Component Serialization Performance Tests', () => {
|
|
|
420
420
|
describe('Performance Regression Detection', () => {
|
|
421
421
|
it('should maintain consistent performance characteristics', () => {
|
|
422
422
|
const benchmarkData = Array.from({ length: 1000 }, (_, i) => ({
|
|
423
|
-
|
|
423
|
+
tagName: 'Section',
|
|
424
424
|
version: '1.0.0',
|
|
425
425
|
data: {
|
|
426
426
|
id: `benchmark-section-${i}`,
|
|
427
427
|
children: [
|
|
428
428
|
{
|
|
429
|
-
|
|
429
|
+
tagName: 'Button',
|
|
430
430
|
version: '1.0.0',
|
|
431
431
|
data: { id: `benchmark-btn-${i}`, label: `Button ${i}` }
|
|
432
432
|
}
|
|
@@ -244,7 +244,7 @@ describe('QA Test Automation Integration', () => {
|
|
|
244
244
|
ComponentTransformer.registerComponent('MockComponent', mockComponent as any);
|
|
245
245
|
|
|
246
246
|
const testData = {
|
|
247
|
-
|
|
247
|
+
tagName: 'MockComponent',
|
|
248
248
|
version: '1.0.0',
|
|
249
249
|
data: { text: 'Unit test' }
|
|
250
250
|
};
|
|
@@ -361,8 +361,8 @@ describe('QA Test Automation Integration', () => {
|
|
|
361
361
|
ComponentTransformer.clearRegistry();
|
|
362
362
|
|
|
363
363
|
const invalidScenarios = [
|
|
364
|
-
{
|
|
365
|
-
{
|
|
364
|
+
{ tagName: 'UnknownComponent', version: '1.0.0', data: {} },
|
|
365
|
+
{ tagName: 'ValidComponent', version: '1.0.0' }, // Missing data
|
|
366
366
|
];
|
|
367
367
|
|
|
368
368
|
let handledErrors = 0;
|
|
@@ -551,12 +551,12 @@ describe('QA Test Automation Integration', () => {
|
|
|
551
551
|
it('should provide standardized test data for consistent testing', () => {
|
|
552
552
|
const standardTestData = {
|
|
553
553
|
simpleButton: {
|
|
554
|
-
|
|
554
|
+
tagName: 'Button',
|
|
555
555
|
version: '1.0.0',
|
|
556
556
|
data: { label: 'Click Me', variant: 'primary' }
|
|
557
557
|
},
|
|
558
558
|
complexCard: {
|
|
559
|
-
|
|
559
|
+
tagName: 'Card',
|
|
560
560
|
version: '1.0.0',
|
|
561
561
|
data: {
|
|
562
562
|
title: 'Test Card',
|
|
@@ -565,7 +565,7 @@ describe('QA Test Automation Integration', () => {
|
|
|
565
565
|
metadata: { author: 'Tester', date: '2025-01-01' },
|
|
566
566
|
actions: [
|
|
567
567
|
{
|
|
568
|
-
|
|
568
|
+
tagName: 'Button',
|
|
569
569
|
version: '1.0.0',
|
|
570
570
|
data: { label: 'Action', variant: 'secondary' }
|
|
571
571
|
}
|
|
@@ -573,7 +573,7 @@ describe('QA Test Automation Integration', () => {
|
|
|
573
573
|
}
|
|
574
574
|
},
|
|
575
575
|
largeDataset: Array.from({ length: 1000 }, (_, i) => ({
|
|
576
|
-
|
|
576
|
+
tagName: 'ListItem',
|
|
577
577
|
version: '1.0.0',
|
|
578
578
|
data: { id: i, text: `Item ${i}` }
|
|
579
579
|
}))
|
|
@@ -586,7 +586,7 @@ describe('QA Test Automation Integration', () => {
|
|
|
586
586
|
|
|
587
587
|
// Test data should be deterministic
|
|
588
588
|
const regeneratedData = Array.from({ length: 1000 }, (_, i) => ({
|
|
589
|
-
|
|
589
|
+
tagName: 'ListItem',
|
|
590
590
|
version: '1.0.0',
|
|
591
591
|
data: { id: i, text: `Item ${i}` }
|
|
592
592
|
}));
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nested Component Serialization Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests to verify that deeply nested component structures can be
|
|
5
|
+
* properly serialized and deserialized without circular references.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Container } from '../../../components/base/Container';
|
|
10
|
+
import { Text } from '../../../components/blocks/Text';
|
|
11
|
+
import { ComponentTransformer } from '../../../schemas/transformers/ComponentTransformer';
|
|
12
|
+
import '../schemas/transformers/registry'; // Ensure components are registered
|
|
13
|
+
|
|
14
|
+
describe('Nested Component Serialization', () => {
|
|
15
|
+
describe('Deep Nesting with Mixed Content', () => {
|
|
16
|
+
it('should serialize and deserialize deeply nested Container and Text components', () => {
|
|
17
|
+
// Create a complex nested structure
|
|
18
|
+
const nestedStructure = (
|
|
19
|
+
<Container
|
|
20
|
+
span={12}
|
|
21
|
+
padding="large"
|
|
22
|
+
background="primary.main"
|
|
23
|
+
onClick={(event) => { console.log("Parent clicked"); }}
|
|
24
|
+
>
|
|
25
|
+
<Container
|
|
26
|
+
span={6}
|
|
27
|
+
padding="medium"
|
|
28
|
+
background="secondary.main"
|
|
29
|
+
>
|
|
30
|
+
<Text variant="h6" color="textSecondary">
|
|
31
|
+
Deep nested text content
|
|
32
|
+
</Text>
|
|
33
|
+
</Container>
|
|
34
|
+
|
|
35
|
+
<Container
|
|
36
|
+
span={6}
|
|
37
|
+
padding="medium"
|
|
38
|
+
background="success.main"
|
|
39
|
+
>
|
|
40
|
+
Simple string content
|
|
41
|
+
</Container>
|
|
42
|
+
</Container>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// Test serialization
|
|
46
|
+
expect(() => {
|
|
47
|
+
const serializedData = ComponentTransformer.serialize(nestedStructure);
|
|
48
|
+
const parsedData = JSON.parse(serializedData);
|
|
49
|
+
|
|
50
|
+
// Verify outer Container structure
|
|
51
|
+
expect(parsedData.tagName).toBe('Container');
|
|
52
|
+
expect(parsedData.version).toBe('1.0.0');
|
|
53
|
+
expect(parsedData.data.span).toBe(12);
|
|
54
|
+
expect(parsedData.data.padding).toBe('large');
|
|
55
|
+
expect(typeof parsedData.data.onClick).toBe('string');
|
|
56
|
+
|
|
57
|
+
// Verify children are serialized as array
|
|
58
|
+
expect(Array.isArray(parsedData.data.children)).toBe(true);
|
|
59
|
+
expect(parsedData.data.children).toHaveLength(2);
|
|
60
|
+
|
|
61
|
+
// Verify first nested Container
|
|
62
|
+
const firstChild = parsedData.data.children[0];
|
|
63
|
+
expect(firstChild.tagName).toBe('Container');
|
|
64
|
+
expect(firstChild.data.span).toBe(6);
|
|
65
|
+
expect(firstChild.data.background).toBe('secondary.main');
|
|
66
|
+
|
|
67
|
+
// Verify deeply nested Text component (single child is not wrapped in array)
|
|
68
|
+
expect(typeof firstChild.data.children).toBe('object');
|
|
69
|
+
expect(firstChild.data.children).not.toBeNull();
|
|
70
|
+
const textComponent = firstChild.data.children;
|
|
71
|
+
expect(textComponent.tagName).toBe('Text');
|
|
72
|
+
expect(textComponent.data.variant).toBe('h6');
|
|
73
|
+
expect(textComponent.data.color).toBe('white');
|
|
74
|
+
expect(textComponent.data.children).toBe('Deep nested text content');
|
|
75
|
+
|
|
76
|
+
// Verify second nested Container with string content
|
|
77
|
+
const secondChild = parsedData.data.children[1];
|
|
78
|
+
expect(secondChild.tagName).toBe('Container');
|
|
79
|
+
expect(secondChild.data.children).toBe('Simple string content');
|
|
80
|
+
|
|
81
|
+
console.log('✅ Nested serialization structure validated');
|
|
82
|
+
|
|
83
|
+
}).not.toThrow();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should perform round-trip serialization/deserialization', () => {
|
|
87
|
+
// Create nested structure
|
|
88
|
+
const originalStructure = (
|
|
89
|
+
<Container span={8} padding="medium" background="info.main">
|
|
90
|
+
<Container span={12} padding="small">
|
|
91
|
+
<Text variant="body1">Level 2 content</Text>
|
|
92
|
+
</Container>
|
|
93
|
+
</Container>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Serialize
|
|
97
|
+
const serializedData = ComponentTransformer.serialize(originalStructure);
|
|
98
|
+
|
|
99
|
+
// Deserialize
|
|
100
|
+
const deserializedComponent = ComponentTransformer.deserialize(serializedData);
|
|
101
|
+
|
|
102
|
+
// Verify it's a valid React element
|
|
103
|
+
expect(React.isValidElement(deserializedComponent)).toBe(true);
|
|
104
|
+
|
|
105
|
+
// Serialize again to verify integrity
|
|
106
|
+
const reserializedData = ComponentTransformer.serialize(deserializedComponent);
|
|
107
|
+
const originalParsed = JSON.parse(serializedData);
|
|
108
|
+
const reserializedParsed = JSON.parse(reserializedData);
|
|
109
|
+
|
|
110
|
+
// Compare key structural elements (skip function references which will differ)
|
|
111
|
+
expect(reserializedParsed.tagName).toBe(originalParsed.tagName);
|
|
112
|
+
expect(reserializedParsed.data.span).toBe(originalParsed.data.span);
|
|
113
|
+
expect(reserializedParsed.data.padding).toBe(originalParsed.data.padding);
|
|
114
|
+
|
|
115
|
+
console.log('✅ Round-trip serialization successful');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should handle mixed primitive and component children', () => {
|
|
119
|
+
const mixedContent = (
|
|
120
|
+
<Container span={12} padding="large">
|
|
121
|
+
String content first
|
|
122
|
+
<Container span={6} padding="small">
|
|
123
|
+
<Text variant="h5">Component content</Text>
|
|
124
|
+
</Container>
|
|
125
|
+
More string content
|
|
126
|
+
<Text variant="body2">Another component</Text>
|
|
127
|
+
Final string
|
|
128
|
+
</Container>
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
expect(() => {
|
|
132
|
+
const serializedData = ComponentTransformer.serialize(mixedContent);
|
|
133
|
+
const parsedData = JSON.parse(serializedData);
|
|
134
|
+
|
|
135
|
+
// Verify mixed children array
|
|
136
|
+
expect(Array.isArray(parsedData.data.children)).toBe(true);
|
|
137
|
+
expect(parsedData.data.children.length).toBeGreaterThan(1);
|
|
138
|
+
|
|
139
|
+
// Should contain both strings and component objects
|
|
140
|
+
const hasStrings = parsedData.data.children.some(child => typeof child === 'string');
|
|
141
|
+
const hasComponents = parsedData.data.children.some(child =>
|
|
142
|
+
typeof child === 'object' && child.tagName
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
expect(hasStrings).toBe(true);
|
|
146
|
+
expect(hasComponents).toBe(true);
|
|
147
|
+
|
|
148
|
+
console.log('✅ Mixed content serialization validated');
|
|
149
|
+
|
|
150
|
+
}).not.toThrow();
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
describe('Error Handling', () => {
|
|
155
|
+
it('should handle empty children gracefully', () => {
|
|
156
|
+
const emptyContainer = <Container span={6} padding="medium" />;
|
|
157
|
+
|
|
158
|
+
expect(() => {
|
|
159
|
+
const serializedData = ComponentTransformer.serialize(emptyContainer);
|
|
160
|
+
const parsedData = JSON.parse(serializedData);
|
|
161
|
+
|
|
162
|
+
// Should not have children property or should be undefined
|
|
163
|
+
expect(parsedData.data.children === undefined || parsedData.data.children === null).toBe(true);
|
|
164
|
+
|
|
165
|
+
}).not.toThrow();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('should handle null children gracefully', () => {
|
|
169
|
+
const nullChildrenContainer = <Container span={6} padding="medium">{null}</Container>;
|
|
170
|
+
|
|
171
|
+
expect(() => {
|
|
172
|
+
const serializedData = ComponentTransformer.serialize(nullChildrenContainer);
|
|
173
|
+
const parsedData = JSON.parse(serializedData);
|
|
174
|
+
|
|
175
|
+
// Null should be preserved
|
|
176
|
+
expect(parsedData.data.children).toBe(null);
|
|
177
|
+
|
|
178
|
+
}).not.toThrow();
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|