@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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SerializationTemplate - Reusable template for component serialization demos
|
|
3
|
+
*
|
|
4
|
+
* Creates standardized serialization stories that demonstrate:
|
|
5
|
+
* - Component serialization to JSON
|
|
6
|
+
* - JSON deserialization back to component
|
|
7
|
+
* - Round-trip validation
|
|
8
|
+
* - JSON structure visualization
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { makeSerializationStory } from '../_templates/SerializationTemplate';
|
|
13
|
+
*
|
|
14
|
+
* export const SerializationDemo = makeSerializationStory(() => (
|
|
15
|
+
* <Button variant="primary" label="Click Me" />
|
|
16
|
+
* ));
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import { ComponentTransformer } from '../../schemas/transformers/ComponentTransformer';
|
|
24
|
+
import { registerSerializableComponents } from '../../schemas/transformers/registry';
|
|
25
|
+
import { Code } from '../../components/blocks/Code';
|
|
26
|
+
import { Box, Typography } from '@mui/material';
|
|
27
|
+
|
|
28
|
+
// Ensure all serializable components are registered
|
|
29
|
+
registerSerializableComponents();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates a serialization demo story for any React element
|
|
33
|
+
*
|
|
34
|
+
* @param makeElement - Function that returns the React element to serialize
|
|
35
|
+
* @returns Story component that demonstrates serialization round-trip
|
|
36
|
+
*/
|
|
37
|
+
export const makeSerializationStory = (makeElement: () => React.ReactElement) => () => {
|
|
38
|
+
const element = makeElement();
|
|
39
|
+
|
|
40
|
+
let serialized: string;
|
|
41
|
+
let roundTrip: React.ReactNode;
|
|
42
|
+
let error: string | null = null;
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
// Serialize the element to JSON
|
|
46
|
+
serialized = ComponentTransformer.serialize(element);
|
|
47
|
+
|
|
48
|
+
// Deserialize back to component
|
|
49
|
+
roundTrip = ComponentTransformer.deserialize(serialized);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
error = err instanceof Error ? err.message : String(err);
|
|
52
|
+
serialized = '{}';
|
|
53
|
+
roundTrip = <div style={{ color: 'red', padding: '16px' }}>Serialization Error: {error}</div>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
58
|
+
{/* Original Component */}
|
|
59
|
+
<Box>
|
|
60
|
+
<Typography variant="h6" component="h3" gutterBottom>
|
|
61
|
+
Original Component
|
|
62
|
+
</Typography>
|
|
63
|
+
<Box sx={{ p: 2, border: '1px solid', borderColor: 'divider', borderRadius: 1 }}>
|
|
64
|
+
{element}
|
|
65
|
+
</Box>
|
|
66
|
+
</Box>
|
|
67
|
+
|
|
68
|
+
{/* Round-trip Component */}
|
|
69
|
+
<Box>
|
|
70
|
+
<Typography variant="h6" component="h3" gutterBottom>
|
|
71
|
+
Deserialized Component (Round-trip)
|
|
72
|
+
</Typography>
|
|
73
|
+
<Box sx={{ p: 2, border: '1px solid', borderColor: 'divider', borderRadius: 1 }}>
|
|
74
|
+
{roundTrip}
|
|
75
|
+
</Box>
|
|
76
|
+
</Box>
|
|
77
|
+
|
|
78
|
+
{/* Serialized JSON */}
|
|
79
|
+
<Box>
|
|
80
|
+
<Typography variant="h6" component="h3" gutterBottom>
|
|
81
|
+
Serialized JSON
|
|
82
|
+
</Typography>
|
|
83
|
+
{error ? (
|
|
84
|
+
<Box sx={{ p: 2, bgcolor: 'error.light', color: 'error.contrastText', borderRadius: 1 }}>
|
|
85
|
+
<Typography variant="body2">Error: {error}</Typography>
|
|
86
|
+
</Box>
|
|
87
|
+
) : (
|
|
88
|
+
<Code
|
|
89
|
+
language="json"
|
|
90
|
+
content={JSON.stringify(JSON.parse(serialized), null, 2)}
|
|
91
|
+
showCopy={true}
|
|
92
|
+
showLineNumbers={true}
|
|
93
|
+
wrapLines={false}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
</Box>
|
|
97
|
+
|
|
98
|
+
{/* Metadata */}
|
|
99
|
+
<Box sx={{ mt: 2, p: 2, bgcolor: 'background.paper', borderRadius: 1, border: '1px solid', borderColor: 'divider' }}>
|
|
100
|
+
<Typography variant="body2" color="text.secondary">
|
|
101
|
+
<strong>How it works:</strong><br />
|
|
102
|
+
1. The original component is serialized to JSON using ComponentTransformer<br />
|
|
103
|
+
2. The JSON is then deserialized back into a React component<br />
|
|
104
|
+
3. Both components should render identically, proving serialization fidelity<br />
|
|
105
|
+
4. The JSON shows the exact structure stored for the component
|
|
106
|
+
</Typography>
|
|
107
|
+
</Box>
|
|
108
|
+
</Box>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Creates a batch serialization demo for multiple elements
|
|
114
|
+
*
|
|
115
|
+
* @param makeElements - Function that returns array of React elements to serialize
|
|
116
|
+
* @returns Story component that demonstrates batch serialization
|
|
117
|
+
*/
|
|
118
|
+
export const makeBatchSerializationStory = (makeElements: () => React.ReactElement[]) => () => {
|
|
119
|
+
const elements = makeElements();
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
|
123
|
+
<Typography variant="h5" component="h2" gutterBottom>
|
|
124
|
+
Batch Serialization Demo
|
|
125
|
+
</Typography>
|
|
126
|
+
|
|
127
|
+
{elements.map((element, index) => {
|
|
128
|
+
const StoryComponent = makeSerializationStory(() => element);
|
|
129
|
+
return (
|
|
130
|
+
<Box key={index} sx={{ p: 2, border: '1px solid', borderColor: 'divider', borderRadius: 1 }}>
|
|
131
|
+
<Typography variant="h6" component="h3" gutterBottom>
|
|
132
|
+
Component #{index + 1}: {element.type?.toString() || 'Unknown'}
|
|
133
|
+
</Typography>
|
|
134
|
+
<StoryComponent />
|
|
135
|
+
</Box>
|
|
136
|
+
);
|
|
137
|
+
})}
|
|
138
|
+
</Box>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Creates a complex serialization demo with nested components
|
|
144
|
+
*
|
|
145
|
+
* @param makeComplexElement - Function that returns a complex nested React element
|
|
146
|
+
* @returns Story component that demonstrates nested component serialization
|
|
147
|
+
*/
|
|
148
|
+
export const makeComplexSerializationStory = (makeComplexElement: () => React.ReactElement) => () => {
|
|
149
|
+
const ComplexStory = makeSerializationStory(makeComplexElement);
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
|
153
|
+
<Box sx={{ p: 2, bgcolor: 'info.light', borderRadius: 1 }}>
|
|
154
|
+
<Typography variant="body2" color="info.contrastText">
|
|
155
|
+
<strong>Complex Serialization:</strong> This demo shows how nested components with multiple
|
|
156
|
+
levels of children are serialized and deserialized while maintaining their structure and behavior.
|
|
157
|
+
</Typography>
|
|
158
|
+
</Box>
|
|
159
|
+
|
|
160
|
+
<ComplexStory />
|
|
161
|
+
</Box>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export default makeSerializationStory;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
6
6
|
*/
|
|
7
|
-
import { Logger,
|
|
7
|
+
import { Logger, getLogger } from '../utils/logger';
|
|
8
8
|
import { CachedDataProvider, DataResponse, ICacheProvider, IDataProvider, MemoryCacheProvider, Model, MustacheTemplateProvider, SelectOptions } from '@qwickapps/schema';
|
|
9
9
|
import {
|
|
10
10
|
DataProxy,
|
|
@@ -51,7 +51,7 @@ export class TemplateResolver implements ITemplateResolver {
|
|
|
51
51
|
private log: Logger;
|
|
52
52
|
|
|
53
53
|
constructor(config: TemplateResolverConfig) {
|
|
54
|
-
this.log =
|
|
54
|
+
this.log = getLogger('ContentResolver');
|
|
55
55
|
this.enableLogging = config.enableLogging || false;
|
|
56
56
|
this.templateResolver = config.templateResolver || new MustacheTemplateProvider();
|
|
57
57
|
if (config.cacheProvider === true) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import React, { ReactNode } from 'react';
|
|
11
|
-
import type { WithDataBinding,
|
|
11
|
+
import type { WithDataBinding, SchemaProps } from '@qwickapps/schema';
|
|
12
12
|
import type { WithBaseProps } from '../hooks/useBaseProps';
|
|
13
13
|
import CollapsibleLayoutModel from '../schemas/CollapsibleLayoutSchema';
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ import CollapsibleLayoutModel from '../schemas/CollapsibleLayoutSchema';
|
|
|
18
18
|
* This interface combines the schema-defined properties with React-specific types
|
|
19
19
|
* and additional component functionality not captured in the schema.
|
|
20
20
|
*/
|
|
21
|
-
export type CollapsibleLayoutViewProps =
|
|
21
|
+
export type CollapsibleLayoutViewProps = SchemaProps<CollapsibleLayoutModel> &
|
|
22
22
|
WithBaseProps & {
|
|
23
23
|
// ========================================
|
|
24
24
|
// React Event Handlers
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for CSS value conversions.
|
|
3
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts a value to a CSS length string.
|
|
8
|
+
* @param value The value to convert (number, string, etc.).
|
|
9
|
+
* @param opts Options for controlling the conversion.
|
|
10
|
+
* @returns The CSS length string (e.g., "10px", "100%", etc.).
|
|
11
|
+
*/
|
|
12
|
+
export function toCssLength(
|
|
13
|
+
value: unknown,
|
|
14
|
+
opts: {
|
|
15
|
+
defaultUnit?: string;
|
|
16
|
+
allowedUnits?: string[];
|
|
17
|
+
allowKeywords?: boolean;
|
|
18
|
+
fallback?: string;
|
|
19
|
+
} = {}
|
|
20
|
+
): string {
|
|
21
|
+
const {
|
|
22
|
+
defaultUnit = 'px',
|
|
23
|
+
allowedUnits = ['px','mm','cm','in','pt','pc'],
|
|
24
|
+
allowKeywords = false,
|
|
25
|
+
fallback = `0${defaultUnit}`
|
|
26
|
+
} = opts;
|
|
27
|
+
|
|
28
|
+
if (value == null) return fallback;
|
|
29
|
+
|
|
30
|
+
if (typeof value === 'number' && isFinite(value)) {
|
|
31
|
+
return `${value}${defaultUnit}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const s = String(value).trim();
|
|
35
|
+
if (!s) return fallback;
|
|
36
|
+
|
|
37
|
+
if (allowKeywords && /^(auto|inherit|initial|unset)$/.test(s)) return s;
|
|
38
|
+
|
|
39
|
+
// Pure numeric string
|
|
40
|
+
if (/^-?\d+(\.\d+)?$/.test(s)) return `${s}${defaultUnit}`;
|
|
41
|
+
|
|
42
|
+
// Number + allowed unit
|
|
43
|
+
const unitPattern = new RegExp(
|
|
44
|
+
`^-?\\d+(?:\\.\\d+)?(${allowedUnits.map(u => u.replace(/[-/\\^$*+?.()|[\]{}]/g,'\\$&')).join('|')})$`
|
|
45
|
+
);
|
|
46
|
+
if (unitPattern.test(s)) return s;
|
|
47
|
+
|
|
48
|
+
return fallback;
|
|
49
|
+
}
|
package/src/utils/index.ts
CHANGED
package/src/utils/logger.ts
CHANGED
|
@@ -51,11 +51,11 @@ class NoOpLogger implements Logger {
|
|
|
51
51
|
/**
|
|
52
52
|
* Create logger with optional @qwickapps/logging dependency
|
|
53
53
|
*/
|
|
54
|
-
function
|
|
54
|
+
function getLogger(name: string): Logger {
|
|
55
55
|
try {
|
|
56
56
|
// Try to use @qwickapps/logging if available
|
|
57
57
|
const logging = require('@qwickapps/logging');
|
|
58
|
-
return logging.
|
|
58
|
+
return logging.getLogger(name);
|
|
59
59
|
} catch {
|
|
60
60
|
// Fallback to console-based logger
|
|
61
61
|
return new ConsoleLogger(name);
|
|
@@ -63,21 +63,21 @@ function createLogger(name: string): Logger {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Re-export Logger type and
|
|
66
|
+
* Re-export Logger type and getLogger function for compatibility
|
|
67
67
|
*/
|
|
68
|
-
export {
|
|
68
|
+
export { getLogger };
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Framework-specific loggers
|
|
72
72
|
*/
|
|
73
73
|
export const loggers: Record<string, Logger> = {
|
|
74
|
-
scaffold:
|
|
75
|
-
navigation:
|
|
76
|
-
auth:
|
|
77
|
-
theme:
|
|
78
|
-
palette:
|
|
79
|
-
form:
|
|
80
|
-
layout:
|
|
81
|
-
menu:
|
|
82
|
-
router:
|
|
74
|
+
scaffold: getLogger('Scaffold'),
|
|
75
|
+
navigation: getLogger('Navigation'),
|
|
76
|
+
auth: getLogger('Auth'),
|
|
77
|
+
theme: getLogger('Theme'),
|
|
78
|
+
palette: getLogger('Palette'),
|
|
79
|
+
form: getLogger('Form'),
|
|
80
|
+
layout: getLogger('Layout'),
|
|
81
|
+
menu: getLogger('Menu'),
|
|
82
|
+
router: getLogger('Router'),
|
|
83
83
|
};
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ModelView Base Class Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests the base ModelView functionality and ensures that components
|
|
5
|
-
* extending it work correctly with serialization.
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { ComponentTransformer } from '../../../schemas/transformers/ComponentTransformer';
|
|
12
|
-
import { Code } from '../../../components/base/../blocks/Code';
|
|
13
|
-
import { Section } from '../../../components/base/../blocks/Section';
|
|
14
|
-
import Button from '../../../components/base/../buttons/Button';
|
|
15
|
-
|
|
16
|
-
describe('ModelView Base Class', () => {
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
ComponentTransformer.clearRegistry();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('Component Registration', () => {
|
|
22
|
-
it('should register all ModelView-based components successfully', () => {
|
|
23
|
-
ComponentTransformer.registerComponent(Code as any);
|
|
24
|
-
ComponentTransformer.registerComponent(Section as any);
|
|
25
|
-
ComponentTransformer.registerComponent(Button as any);
|
|
26
|
-
|
|
27
|
-
const registeredComponents = ComponentTransformer.getRegisteredComponents();
|
|
28
|
-
|
|
29
|
-
expect(registeredComponents).toContain('Code');
|
|
30
|
-
expect(registeredComponents).toContain('Section');
|
|
31
|
-
expect(registeredComponents).toContain('Button');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should have correct tagName and version properties', () => {
|
|
35
|
-
expect(Code.tagName).toBe('Code');
|
|
36
|
-
expect(Code.version).toBe('1.0.0');
|
|
37
|
-
|
|
38
|
-
expect(Section.tagName).toBe('Section');
|
|
39
|
-
expect(Section.version).toBe('1.0.0');
|
|
40
|
-
|
|
41
|
-
expect(Button.tagName).toBe('Button');
|
|
42
|
-
expect(Button.version).toBe('1.0.0');
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('Serialization Pattern', () => {
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
ComponentTransformer.registerComponent(Code as any);
|
|
49
|
-
ComponentTransformer.registerComponent(Section as any);
|
|
50
|
-
ComponentTransformer.registerComponent(Button as any);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should serialize Code component correctly', () => {
|
|
54
|
-
const codeElement = <Code language="javascript" showCopy={true}>
|
|
55
|
-
console.log("Hello, World!");
|
|
56
|
-
</Code>;
|
|
57
|
-
|
|
58
|
-
const codeInstance = new Code({
|
|
59
|
-
language: 'javascript',
|
|
60
|
-
showCopy: true,
|
|
61
|
-
children: 'console.log("Hello, World!");'
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const serialized = codeInstance.toJson();
|
|
65
|
-
|
|
66
|
-
expect(serialized).toMatchObject({
|
|
67
|
-
children: 'console.log("Hello, World!");',
|
|
68
|
-
language: 'javascript',
|
|
69
|
-
showCopy: true,
|
|
70
|
-
dataSource: undefined,
|
|
71
|
-
bindingOptions: undefined
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('should serialize Section component correctly', () => {
|
|
76
|
-
const sectionInstance = new Section({
|
|
77
|
-
background: '#f5f5f5',
|
|
78
|
-
padding: 'large',
|
|
79
|
-
children: 'Section content'
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const serialized = sectionInstance.toJson();
|
|
83
|
-
|
|
84
|
-
expect(serialized).toMatchObject({
|
|
85
|
-
children: 'Section content',
|
|
86
|
-
background: '#f5f5f5',
|
|
87
|
-
padding: 'large',
|
|
88
|
-
dataSource: undefined,
|
|
89
|
-
bindingOptions: undefined
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should serialize Button component correctly', () => {
|
|
94
|
-
const buttonInstance = new Button({
|
|
95
|
-
label: 'Click me',
|
|
96
|
-
variant: 'primary',
|
|
97
|
-
disabled: false,
|
|
98
|
-
children: 'Click me'
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const serialized = buttonInstance.toJson();
|
|
102
|
-
|
|
103
|
-
expect(serialized).toMatchObject({
|
|
104
|
-
children: 'Click me',
|
|
105
|
-
label: 'Click me',
|
|
106
|
-
variant: 'primary',
|
|
107
|
-
disabled: false,
|
|
108
|
-
dataSource: undefined,
|
|
109
|
-
bindingOptions: undefined
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe('Data Binding Props', () => {
|
|
115
|
-
it('should include data binding props in serialization when present', () => {
|
|
116
|
-
const codeInstance = new Code({
|
|
117
|
-
language: 'javascript',
|
|
118
|
-
children: 'test code',
|
|
119
|
-
dataSource: 'api.code.example',
|
|
120
|
-
bindingOptions: { cache: true, strict: false }
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
const serialized = codeInstance.toJson();
|
|
124
|
-
|
|
125
|
-
expect(serialized.dataSource).toBe('api.code.example');
|
|
126
|
-
expect(serialized.bindingOptions).toEqual({ cache: true, strict: false });
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
describe('Common Base Props', () => {
|
|
131
|
-
it('should handle common props like className and id', () => {
|
|
132
|
-
const codeInstance = new Code({
|
|
133
|
-
language: 'javascript',
|
|
134
|
-
children: 'test',
|
|
135
|
-
className: 'my-custom-code',
|
|
136
|
-
id: 'code-block-1'
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const serialized = codeInstance.toJson();
|
|
140
|
-
|
|
141
|
-
expect(serialized.className).toBe('my-custom-code');
|
|
142
|
-
expect(serialized.id).toBe('code-block-1');
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('Deserialization', () => {
|
|
147
|
-
beforeEach(() => {
|
|
148
|
-
ComponentTransformer.registerComponent(Code as any);
|
|
149
|
-
ComponentTransformer.registerComponent(Section as any);
|
|
150
|
-
ComponentTransformer.registerComponent(Button as any);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('should deserialize Code component correctly', () => {
|
|
154
|
-
const jsonData = {
|
|
155
|
-
children: 'console.log("test");',
|
|
156
|
-
language: 'javascript',
|
|
157
|
-
showCopy: true
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const element = Code.fromJson(jsonData);
|
|
161
|
-
|
|
162
|
-
expect(React.isValidElement(element)).toBe(true);
|
|
163
|
-
expect(element.type).toBe(Code);
|
|
164
|
-
expect(element.props).toMatchObject(jsonData);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('should deserialize Section component correctly', () => {
|
|
168
|
-
const jsonData = {
|
|
169
|
-
children: 'Section content',
|
|
170
|
-
background: '#ffffff',
|
|
171
|
-
padding: 'medium'
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const element = Section.fromJson(jsonData);
|
|
175
|
-
|
|
176
|
-
expect(React.isValidElement(element)).toBe(true);
|
|
177
|
-
expect(element.type).toBe(Section);
|
|
178
|
-
expect(element.props).toMatchObject(jsonData);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
it('should deserialize Button component correctly', () => {
|
|
182
|
-
const jsonData = {
|
|
183
|
-
label: 'Test Button',
|
|
184
|
-
variant: 'outlined',
|
|
185
|
-
disabled: false
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const element = Button.fromJson(jsonData);
|
|
189
|
-
|
|
190
|
-
expect(React.isValidElement(element)).toBe(true);
|
|
191
|
-
expect(element.type).toBe(Button);
|
|
192
|
-
expect(element.props).toMatchObject(jsonData);
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
describe('Rendering Patterns', () => {
|
|
197
|
-
it('should render traditional props correctly', () => {
|
|
198
|
-
const codeInstance = new Code({
|
|
199
|
-
language: 'javascript',
|
|
200
|
-
children: 'test code'
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
const rendered = codeInstance.render();
|
|
204
|
-
|
|
205
|
-
expect(React.isValidElement(rendered)).toBe(true);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('should render with data binding when dataSource is present', () => {
|
|
209
|
-
const codeInstance = new Code({
|
|
210
|
-
language: 'javascript',
|
|
211
|
-
children: 'test code',
|
|
212
|
-
dataSource: 'api.code.example'
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
const rendered = codeInstance.render();
|
|
216
|
-
|
|
217
|
-
expect(React.isValidElement(rendered)).toBe(true);
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ViewModel Schema Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for ViewModelSchema functionality and validation
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { ViewModelSchema } from '../../schemas/ViewModelSchema';
|
|
8
|
-
|
|
9
|
-
describe('ViewModelSchema', () => {
|
|
10
|
-
it('should create a valid ViewModelSchema instance', () => {
|
|
11
|
-
const viewModel = new ViewModelSchema();
|
|
12
|
-
expect(viewModel).toBeInstanceOf(ViewModelSchema);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('should have correct schema metadata', () => {
|
|
16
|
-
const schema = ViewModelSchema.getSchema();
|
|
17
|
-
expect(schema.name).toBe('ViewModel');
|
|
18
|
-
expect(schema.version).toBe('1.0.0');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should validate optional properties correctly', async () => {
|
|
22
|
-
const data = {
|
|
23
|
-
className: 'test-class',
|
|
24
|
-
id: 'test-id',
|
|
25
|
-
hidden: true,
|
|
26
|
-
'aria-label': 'Test label',
|
|
27
|
-
'data-testid': 'test-element'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const result = await ViewModelSchema.validate(data);
|
|
31
|
-
expect(result.isValid).toBe(true);
|
|
32
|
-
expect(result.errors).toHaveLength(0);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('should validate style property as string', async () => {
|
|
36
|
-
const data = {
|
|
37
|
-
style: '{"color": "red", "margin": "10px"}'
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const result = await ViewModelSchema.validate(data);
|
|
41
|
-
expect(result.isValid).toBe(true);
|
|
42
|
-
expect(result.errors).toHaveLength(0);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('should handle empty instance without errors', async () => {
|
|
46
|
-
const data = {};
|
|
47
|
-
|
|
48
|
-
const result = await ViewModelSchema.validate(data);
|
|
49
|
-
expect(result.isValid).toBe(true);
|
|
50
|
-
expect(result.errors).toHaveLength(0);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should create instance with default values', () => {
|
|
54
|
-
const data = {
|
|
55
|
-
className: 'test-class',
|
|
56
|
-
id: 'test-id',
|
|
57
|
-
hidden: true
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const viewModel = ViewModelSchema.createWithDefaults(data);
|
|
61
|
-
expect(viewModel.className).toBe('test-class');
|
|
62
|
-
expect(viewModel.id).toBe('test-id');
|
|
63
|
-
expect(viewModel.hidden).toBe(true);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should create instance from JSON data correctly', () => {
|
|
67
|
-
const jsonData = {
|
|
68
|
-
className: 'restored-class',
|
|
69
|
-
id: 'restored-id',
|
|
70
|
-
hidden: false,
|
|
71
|
-
'aria-label': 'Restored label'
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const viewModel = ViewModelSchema.createWithDefaults(jsonData);
|
|
75
|
-
expect(viewModel.className).toBe('restored-class');
|
|
76
|
-
expect(viewModel.id).toBe('restored-id');
|
|
77
|
-
expect(viewModel.hidden).toBe(false);
|
|
78
|
-
expect(viewModel['aria-label']).toBe('Restored label');
|
|
79
|
-
});
|
|
80
|
-
});
|